I wanted to know the IP address of a website.One way is to ping the website.For example if I want to know the ip address of google.com then I can ping in command prompt.

Pinging google.com [] with 32 bytes of data:

Reply from bytes=32 time=36ms TTL=49
Reply from bytes=32 time=35ms TTL=49
Reply from bytes=32 time=64ms TTL=49
Reply from bytes=32 time=47ms TTL=49

So here is the IP address of google.But for suppose I want to know the IP address of superuser.com and if I try using the same way then I get IP address.But If I put this IP addess in browser url then my browser does not take me to superuser.com.

Can anyone tell me how to get the IP address?

  • There is no such thing as "the IP address of a website". – David Schwartz Feb 11 '14 at 23:07
  • @DavidSchwartz Thanks for sharing information.When we ping google.com then we get Isnt IP address of google,If not then what we call this? – SpringLearner Feb 12 '14 at 3:30
  • That's the IP address of some machine, possibly one of many, that you can contact to access the website. – David Schwartz Feb 12 '14 at 5:00
  • @DavidSchwartz I have a web application in my local system.Do you know how to access the app from WAN?I used port forwarding but its not successful – SpringLearner Feb 12 '14 at 5:04
  • "It didn't work" is not a helpful problem description. – David Schwartz Feb 12 '14 at 5:36

Your starting assumption is that all websites can be accessed via their IP address directly. This is not the case.

In many cases (I'd venture most cases) the website that is presented at an IP address is dependent on the website name you are requesting. Ie, if you request superuser.com you will first resolve this to an IP address, then make a request to the IP address for a specific webpage. It looks like this:

GET / HTTP/1.1
Host: superuser.com:80

The first part says "get the first page of the site", and the second says "for the website superuser.com"

This is why a single webserver can host multiple websites using a single IP address. In the case of the Stack Exchange sites, any or all of them can be on each of their servers, and you'll get the one you ask for. If you just put in an IP address, you won't get any of them, because you are not telling the webserver which of the many websites you are after. In these cases, it may have a "default" website defined, or just return an error.

If you are trying to work around an issue with your DNS provider, then one option you have is to modify your hosts file so that you are resolving addresses yourself, rather than have an external party do it for you.

So for example, if you edit

/etc/hosts   (linux)
c:\windows\system32\drivers\etc\hosts   (windows)

You can enter superuser.com

This way, if you type superuser.com into your browser, it will look in the hosts file, and resolve the IP address, but then still pass through the name of the website to the server it connects to.

| improve this answer | |
  • Thanks for the answer.Pinging google.com gives me and pinging gmail.com gives me but if type in the browser URL then it takes me to google.Can you please tell me why? – SpringLearner Feb 3 '14 at 8:52
  • For the same reason. There is a server at .214 that can serve both gmail or google.com. As you aren't specifying which one you want, it is serving google.com by default. Perhaps you can edit your question and describe the problem you are having that you are trying to solve by using IP addresses, and we can come up with a solution that works. – Paul Feb 3 '14 at 9:10
  • I just wanted know the IP address of websites.This only I want. – SpringLearner Feb 3 '14 at 9:18
  • @JqueryLearner: This is the correct answer. Websites can share an IP address, which in reverse means that one IP address can serve multiple websites. – MSalters Feb 3 '14 at 11:53
  • Also note that a website can have more than one IP address: yet another reason to regard "the IP address of a website" as a meaningless phrase. – kreemoweet Feb 12 '14 at 0:56

To get the IP address of a website. The best way is to use nslookup command. For example:

nslookup superuser.com
Server:  google-public-dns-a.google.com

Non-authoritative answer:
Name:    superuser.com

If you wonder why you cannot visit superuser directly from IP address (, it is because of the settings of web server.

Here, superuser's site disallows user visit via IP address. Probably it is because the IP address is binding to other web sites (say stackoverflow.com).

If you use "IP reverse lookup" tool, you can find its binding sites.

One more lookup proves I am right:

nslookup stackoverflow.com
Server:  google-public-dns-a.google.com

Non-authoritative answer:
Name:    stackoverflow.com
| improve this answer | |
  • Can you please tell me what is the meaning of this Server: google-public-dns-a.google.com – SpringLearner Feb 3 '14 at 9:33
  • this is the server name of You can test by pinging google-public-dns-a.google.com – lesca Feb 3 '14 at 10:15
  • for every site do I need to give – SpringLearner Feb 3 '14 at 10:18
  • @JqueryLearner It's just a DNS used for resolving server names like superuser.com. Typically, you are using your local DNS, you can check it out by just typing nslookup. This command use the local DNS by default. – lesca Feb 3 '14 at 10:21

Firefox have a nice addon which shows the OP address of any website you visit which you can get from here

| improve this answer | |
  • Thanks for the answer.Isnt there any way from command prompt or by any other way without using plugins – SpringLearner Feb 3 '14 at 8:32
  • Well ping works just fine or any IP lookup service online should be able to provide the information you want. – Matthew Williams Feb 3 '14 at 8:36
  • Ping works for some sites.As i said it works for google but not superuser – SpringLearner Feb 3 '14 at 8:37
  • Ping superuser works just fine for me. Must be a problem on your end. Any specific reason a plugin won't suite your needs? – Matthew Williams Feb 3 '14 at 8:39
  • what is the IP you are getting when you ping superuser – SpringLearner Feb 3 '14 at 8:41

Flagfox add-on for Firefox gives you the ip address of the current website, along with a wealth of other information about the website (including a geolocation map of the server location). A menu selection within the add-on's pulldown allows you to copy the IP address to your clipboard if desired.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.