dig

nslookup has been deprecated. Use dig to resolve name.

dig stands for domain information groper.

To look up the IP of a given hostname:

dig +short oracle.com

To look up the hostname of a given IP:

dig -x 141.146.8.66

The +domain parameter is useful when you are looking for a host inside a domain. For instance, suppose you are searching for the host otn in the oracle.com domain, you can either use:

dig +short otn.oracle.com

Or you can use the +domain parameter:

dig +short +tcp  +domain=oracle.com otn
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License