Connecting the Arduino to the Internet

Hello, I have installed Windows 2003 and I have configured the DNS and the DHCP and tested if I am able to connect to the internet and I am able to. I have connected the Arduino with the Ethernet Shield and I have written the following code (you will find in the attachment). When I open the serial monitor it says connecting then it says connection failed any suggestion on how to connect to the internet with the arduino.

Thank You

sketch_feb13a.ino (1.17 KB)

You haven't specified a DNS server in your sketch but give the connect method just a host name and not an IP. How do you expect the library to resolve the host name to an IP?

BTW: the header file specifies the method like this:

  void begin(uint8_t *mac_address, IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet);

So you're giving the parameters in the wrong order resulting in the subnet being interpreted as the gateway address. Are you using a current IDE (version 1.0.3)?