How to I get the IP address of a given website,such as serverfault.com?
|
feedback
|
|
From a command-prompt:
Bear in mind that with load-balancers, geo-DNS systems, etc, that the IP address you get back might have no real relationship to the IP address actually assigned to the web server. | |||||
feedback
|
|
on a linux or mac system you can also use the command
| |||
feedback
|
|
ping serverfault.com look for the IP address in the output. C:\Documents and Settings\user>ping serverfault.com Pinging serverfault.com [69.59.196.212] with 32 bytes of data: Reply from 69.59.196.212: bytes=32 time=63ms TTL=111 Reply from 69.59.196.212: bytes=32 time=58ms TTL=111 Reply from 69.59.196.212: bytes=32 time=63ms TTL=111 Reply from 69.59.196.212: bytes=32 time=67ms TTL=111 Ping statistics for 69.59.196.212: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 58ms, Maximum = 67ms, Average = 62ms | |||||
feedback
|
|
you probably want the A record, "host" is the simplest way to get it: host -t A serverfault.com serverfault.com has address 69.59.196.212 dig gives you a little more information: ~: dig serverfault.com ; <<>> DiG 9.5.1-P2-RedHat-9.5.1-2.P2.fc10 <<>> serverfault.com ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17080 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2 ;; QUESTION SECTION: ;serverfault.com. IN A ;; ANSWER SECTION: serverfault.com. 3484 IN A 69.59.196.212 <--- this is what you want ;; AUTHORITY SECTION: serverfault.com. 3484 IN NS ns22.domaincontrol.com. dig is also telling you that ns22.domaincontrol.com is the name server for serverfault. If you want to be sure you're getting the right IP address, you can query that nameserver: ~: dig @ns22.domaincontrol.com serverfault.com ; <<>> DiG 9.5.1-P2-RedHat-9.5.1-2.P2.fc10 <<>> @ns22.domaincontrol.com serverfault.com ; (1 server found) ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4726 ;; flags: qr aa; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 0 ;; QUESTION SECTION: ;serverfault.com. IN A ;; ANSWER SECTION: serverfault.com. 3600 IN A 69.59.196.212 <-- we had the right one using "host" | |||
|
feedback
|
|
Notice, that there could be hundreds or even thousands web sites "hiding" behind a single ip address if the web server serves named virtual hosts. See e.g. the | ||||
|
feedback
|
|
In Windows, open a command prompt (Start->Run, type cmd) and run the command:
| |||
|
feedback
|
| |||
|
feedback
|
|
If you're on a host that only permits root to ping:
then you can use wget to check ip:
As a bonus you get to know if the server is up and running. | |||
feedback
|
|
A web site may have more than one IP -- for instance, what is the IP address of www.google.com? Well, the answer is that it depends. For me it is an alias to www.l.google.com, which itself is either 64.233.161.147 or 64.233.161.104. But if I ask a different DNS server, I get 74.125.65.147 or 74.125.65.99 or 74.125.65.103 or 74.125.65.104. | |||
|
feedback
|