Glam Prestige Journal

Bright entertainment trends with youth appeal.

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 [74.125.236.195] with 32 bytes of data:
Reply from 74.125.236.195: bytes=32 time=36ms TTL=49
Reply from 74.125.236.195: bytes=32 time=35ms TTL=49
Reply from 74.125.236.195: bytes=32 time=64ms TTL=49
Reply from 74.125.236.195: bytes=32 time=47ms TTL=49

So here 74.125.236.195 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 198.252.206.16 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?

8

4 Answers

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

74.125.236.195 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.

5

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

nslookup superuser.com 8.8.8.8
Server: google-public-dns-a.google.com
Address: 8.8.8.8
Non-authoritative answer:
Name: superuser.com
Address: 198.252.206.16

If you wonder why you cannot visit superuser directly from IP address (198.252.206.16), 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 8.8.8.8
Server: google-public-dns-a.google.com
Address: 8.8.8.8
Non-authoritative answer:
Name: stackoverflow.com
Address: 198.252.206.16
4

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

6

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.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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