How to Find a Websites IP Address

Jun 1, 2010 - 9 Comments

Terminal in OS X

Finding the numerical IP address of a website or domain URL is pretty easy. We’ll use a terminal utility called nslookup, the command can be used to discover whatever domain resolves to a specific IP. This works for Macs with OS X but also in other unix varieties and even Windows DOS prompt too.

Finding a Website / Domain Associated IP Address with nslookup

To get started on a Mac or Linux machine, open a new Terminal window and simply type the following command:


Replace ‘’ with the domain you are interested in finding the IP for.

You’ll then see something like this printed back at you:

$ nslookup
Non-authoritative answer:

The ‘non-authoritative answer’ will show you the original domain name of the website or URL queried with the resolving IP address below.

In this example, the number underneath is the IP address for

If you want to cut to just the IP addresses of the target domain without your own information, you can grep for “Address” and ignore the first response like so:

nslookup |grep Address

Note that some larger websites will have multiple IP responses for a variety of purposes, ranging from redundancy to distributing load and for DNS purposes.

Retrieving a Website / Domain IP Address with dig

An alternative approach is to use the dig command, which is similar to nslookup but provides a more detailed return of DNS lookup:

dig [domain]

For example, on the very own set to a local environment, a dig lookup would provide the following DNS details for that website:

% dig

; <<>> DiG 9.8.3-P1 <<>>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31810 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ; IN A ;; ANSWER SECTION: 29 IN A ;; Query time: 76 msec ;; SERVER: ;; WHEN: Thu Mar 19 12:17:20 2015 ;; MSG SIZE rcvd: 46

There's any number of reasons why you'd want a websites numerical address rather than their resolved domain, from troubleshooting DNS problems, to determining domain neighbors, to configuring network settings.

Whether to use nslookup or dig is up to you, both work just fine in all versions of Mac OS X and in all versions of Linux. Happy domain resolving!


Related articles:

Posted by: Paul Horowitz in Command Line, Tips & Tricks


» Comments RSS Feed

  1. Programmer says:

    You should use dig + short it is the best way to show ip addresses only without any additional info in the output. For instance

  2. artgon says:

    Now better Terminal add-on utility created on GitHub. Works better then built in Terminal servises

  3. saradhi says:

    Hi, iam using nslookup tool so i want to know website IP address but it has set firewall already so It is showing Firewall IP address, Let me know how to get website original ip address .

  4. Jamie says:

    Touche. Great arguments. Keep up the amazing work.

  5. Silvah_dah_Techhog says:

    Of course, Pinging. I forgot ’bout that. Nice alternatives, though!

  6. eesh says:

    yeah boos what ever u want just ping and required site and cmd will give u entire detail….
    ex ping

  7. Asnavour says:

    hey, 192.168.0.* isn’t it a local ip address?
    how come it shows

  8. Gordon Buchanan says:

    or you could just ping it … ping

Leave a Reply


Shop on and help support OSXDaily!

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks


iPhone / iPad



Shop on Amazon to help support this site