Expected outcome of WebClient Example?

I'm using a Mega compatible Ethernet shield, on a Mega 2560, with 1.5.7. There were a few solder bridges on the W5100 I got them cleaned up so now it connects after a restart.

I'm testing it out to make sure it's working and I'm not sure if I'm getting the right results or not.

WebClient example code.

  Web client
 This sketch connects to a website (http://www.google.com)
 using an Arduino Wiznet Ethernet shield.
 * Ethernet shield attached to pins 10, 11, 12, 13
 created 18 Dec 2009
 by David A. Mellis
 modified 9 Apr 2012
 by Tom Igoe, based on work by Adrian McEwen

#include <SPI.h>
#include <Ethernet.h>

// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// if you don't want to use DNS (and reduce your sketch size)
// use the numeric IP instead of the name for the server:
//IPAddress server(74,125,232,128);  // numeric IP for Google (no DNS)
char server[] = "www.google.com";    // name address for Google (using DNS)

// Set the static IP address to use if the DHCP fails to assign
IPAddress ip(192,168,0,177);

// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
EthernetClient client;

void setup() {
 // Open serial communications and wait for port to open:
   while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only

  // start the Ethernet connection:
  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    // no point in carrying on, so do nothing forevermore:
    // try to congifure using IP address instead of DHCP:
    Ethernet.begin(mac, ip);
  // give the Ethernet shield a second to initialize:

  // if you get a connection, report back via serial:
  if (client.connect(server, 80)) {
    // Make a HTTP request:
    client.println("GET /search?q=arduino HTTP/1.1");
    client.println("Host: www.google.com");
    client.println("Connection: close");
  else {
    // kf you didn't get a connection to the server:
    Serial.println("connection failed");

void loop()
  // if there are incoming bytes available
  // from the server, read them and print them:
  if (client.available()) {
    char c = client.read();

  // if the server's disconnected, stop the client:
  if (!client.connected()) {

    // do nothing forevermore:

The results I'm getting, looks like the most of the HTML code for the page after some preamble about the.

Failed to configure Ethernet using DHCP
connection failed

HTTP/1.1 200 OK
Date: Mon, 29 Sep 2014 19:27:09 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
Set-Cookie: PREF=ID=3279ff384b3ce946:FF=0:TM=1412018829:LM=1412018829:S=0mdNk6V7KxnC7fKg; expires=Wed, 28-Sep-2016 19:27:09 GMT; path=/; domain=.google.com
Set-Cookie: NID=67=M_4VTZqrV6Z67dYwHgOrDXTaPnwEJW7trc6Ztn1gFTTS1MGOU761NDNv7DhlRPQHTu6IKxkvaz61M8ufVLxQjuueplosM3X6HnubxKUmgGoRqVC9tSk7BKaUSAFHNkE5; expires=Tue, 31-Mar-2015 19:27:09 GMT; path=/; domain=.google.com; HttpOnly
P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
Server: gws
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Alternate-Protocol: 80:quic,p=0.01
Connection: close

Then it lists the unformatted HTML code.

Except for the "Failed to configure Ethernet using DHCP" message, it worked fine. I got the same result using that code, but I didn't get the dhcp fail message.

If you have a SD card in the shield's slot, that can cause the DHCP function to fail.

Great! I was worried I hadn't cleaned up the solder bridges enough. The example didn't show what the output result would be so I was confused by it.

Thanks for the quick reply!