Perform DNS Lookups


host

The Domain Name System (DNS) was created to make it easier for humans to access resources on the Internet. Computers work beautifully with numbersafter all, everything a computer does is really a numberbut humans can remember and process words much more efficiently. A website might be located at 72.14.203.99, but it would be hard for most people to remember that. Instead, it's much easier to keep in memory that you want to go to www.google.com. DNS is basically a giant database that keeps track of the relationship between 72.14.203.99 and www.google.com, and millions of other IP addresses and domain names as well.

Tip

DNS is a large, complicated, and fascinating topic. For more details, see Wikipedia's "Domain Name System" (http://en.wikipedia.org/wiki/Dns) to start, and then jump into Paul Albitz and Cricket Liu's seminal DNS and BIND.


To quickly find the IP address associated with a domain name, use the host command:

$ host www.granneman.com www.granneman.com is an alias for granneman.com. granneman.com has address 216.23.180.5 www.granneman.com is an alias for granneman.com. www.granneman.com is an alias for granneman.com. granneman.com mail is handled by 30 bhoth.pair.com. 


There are five responses because host performs several types of DNS lookups. It's easy, however, to see what you wanted: www.granneman.com can be found at 216.23.180.5.

You can also reverse the process, and find out a domain name associated with an IP.

$ host 65.214.39.152 152.39.214.65.in-addr.arpa domain name pointer  web.bloglines.com. 


Note

Many other commands will reveal a host's IP address, but host is the most efficient way to perform this task. Not to mention, you can do reverse lookups with host, which is not always possible with other commands.


Find out more about how host can help you at the end of this chapter in "Troubleshooting Network Problems."



Linux Phrasebook
Linux Phrasebook
ISBN: 0672328380
EAN: 2147483647
Year: 2007
Pages: 288

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net