Get IP Address from Website

Hello everybody!

First of all, sorry for my english, but i'm from brazil.

I'm working in a project that is a network monitor. The company that i work needs constant internet connection, so I decided to build a network monitor.

What i'm trying to do is to check internet connection by using "ping" on a server like google. Besides that, i want to check if all our services (Email, website and servers) are online.

I am able to connect my arduino uno + ethernet shield to my network, geting a valid IP Address.

So, here is the script I want to build:

1st - Connect the arduino to network with a valid local IP and MAC.
I am able to do this by using "DHCPAddressPrinter" found here.

2nd - Get the IP address of the websites
I want to get the ip address of services like "", "", "".....

3rd - Will ping this addresses by using "Ping" example avaliable in "ICMP Ping Library" here.

Since the ping function is working only with an IP address, not a hostname, I need a function that I enter the address "" and it returns a number ( for me in Brazil, right now :slight_smile: ). So I think what i need is kinda request for a DNS server to "translate" the website for an IP address.

The servers with "" runs on a shared hosting, so there is no fixed IP number

I found that the example "Ethernet" -> "Webclient" makes a HTTP request with "", but I could not make it show the IP address of the website.

Of course I don't need the full code for my project, just this part of the "translation" from "" for an IP by a DNS server.

Is that possible?

Once I make it work, I will show here the results.
I'm thinking about using an LCD display to show this monitor display.

Thanks for that.

#include <Dns.h>

IPAddress serverIP; // server IP after dns call
DNSClient dnClient;

  if(dnClient.getHostByName("",serverIP) == 1) {
    Serial.print(F("server ip = "));
  else Serial.print(F("dns lookup failed"));