A Quick Guide to DNS Lookup

On 2010年12月10日, in linux, tips, by netoearth

DNS lookup is a good tool for general domain inquiries, server testing, and for following security leads. It is easy to do, and most Linux and Unix dedicated servers come with the commands you need. All you have to do is log on via SSH and get started.

The first command you can use for basic DNS lookups is “host”. For example, to look up the A record for tavisonline.com, you would type from the command line:

$ host -t a tavisonline.com

and the output is:
tavisonline.com has address

Similarly, you can search for MX, CNAME, and other record types. To search for name servers, you would enter:

$ host -t ns tavisonline.com

You can also perform a reverse IP lookup by typing “host” followed by the IP address:

$ host 22.333.44.55

and the output is:

55.44.333.22.in-addr.arpa domain name pointer fakesite.domain.tld

Another useful tool for DNS lookup is “dig”. With a simple command, you can retrieve detailed DNS information about a site. To retrieve an A record, from the command line, type:

$ dig tavisonline.com a

The output is:

; <<>> DiG 9.7.1-P2 <<>> tavisonline.com a
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41028
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;tavisonline.com. IN A

tavisonline.com. 9005 IN A

;; Query time: 2 msec
;; WHEN: Thu Dec 9 14:04:57 2010
;; MSG SIZE rcvd: 49

For more information about the “host” or “dig” commands, type “man host” or “man dig” from the system shell prompt of your dedicated server.

Tagged with:  

Comments are closed.