Query Internet name servers with a certain DNS server
host, nslookup and dig command used to query Internet name servers interactively (DNS lookup utility). Any one of these command is normally use to convert names to IP addresses and vice versa. These utilities are real lifesaver when you want to troubleshoot problem.
By default, they query and use name server specified in /etc/resolve.conf file. For example, consider output nslookup (use default name server):
$ nslookup
Output:
>cyberciti.biz Server: ns9.san.yahoo.com. Address: 216.109.116.20#53 Name: cyberciti.biz Address: 68.142.234.46 Name: cyberciti.biz Address: 68.142.234.47 Name: cyberciti.biz Address: 68.142.234.44 Name: cyberciti.biz Address: 68.142.234.45
Now execute same command as follows:
$ nslookup - ns1.net4india.com
Output:
> cyberciti.biz Server: ns1.net4india.com Address: 202.71.129.33#53 Name: cyberciti.biz Address: 67.15.117.192
When the first argument is a hyphen (-) and the second argument is the Internet address of a name server, you are forcing to use a certain name server to nslookup command. This is handy to debug domain related problems. Simlarly you can force dig command to use a certain name server:
$ dig @ns1.net4india.com +qr cyberciti.biz
OR force host command to use a certain nameserver:
$ host cyberciti.biz ns1.net4india.com
See also:
- How do I setup as DNS client?
- How do I improve DNS performance on Linux/Windows Desktop?
- Consult man page of dig, host, and nslookup for more info.
Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
You may also be interested in other helpful articles:
- How does query caching in MySQL works and how to find find out my MySQL query cache is working or not?
- Enable the query cache in MySQL to improve performance
- Solaris UNIX: How to Setup DNS Client configuration / name server
- Google Security Survey Finds Microsoft IIS Web Servers More Vulnerable Than Apache
- How to find, use, and manage Linux documentations locally and on the Internet
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!


Recent Comments
Today ~ 12 Comments
Today ~ 6 Comments
Today ~ 21 Comments
Today ~ 1 Comment
Today ~ 1 Comment