Operating System - HP-UX
1819807 Members
2788 Online
109607 Solutions
New Discussion юеВ

advantage of dig compared to nslookup

 
SOLVED
Go to solution
Shivkumar
Super Advisor

advantage of dig compared to nslookup

What are the advantages of dig compared to nslookup ?

Regards,
Shiv
12 REPLIES 12
Joseph Loo
Honored Contributor
Solution

Re: advantage of dig compared to nslookup

hi shiv,

u may like to refer to this:

http://www.unix.org.ua/orelly/networking_2ndEd/dns/ch12_09.htm

regards.
what you do not see does not mean you should not believe
Sivakumar TS
Honored Contributor

Re: advantage of dig compared to nslookup

Dear Shiv,

Domain Information Groper. Similar to nslookup, dig does an Internet "name server lookup" on a host.

With dig, you specify all aspects of the query you'd like to send on the command line; there's no interactive mode. You specify the domain name you want to look up as an argument, and the type of query you want to send (e.g., a for address records, mx for MX records) as another argument; the default is to look up address records. You specify the name server you'd like to query after an "@." You can use either a domain name or an IP address to designate a name server. The default is to query the name servers in resolv.conf.

dig is smart about arguments, too. You can specify the arguments in any order you like, and dig will figure out that mx is probably the type of records, not the domain name, you want to look up.

With Regards,

Siva.

Nothing is Impossible !
Arunvijai_4
Honored Contributor

Re: advantage of dig compared to nslookup

Hi Shiv,

Dig is used to query name servers and it is more general than nslookup, it is used by many other tools because its consistent output format is easy to parse automatically.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Arunvijai_4
Honored Contributor

Re: advantage of dig compared to nslookup

Hi Shiv,

If you are interested in DNS tools, have a look at this page. It has got many tools available.

http://www.dns.net/dnsrd/tools.html

Here is a live site where can play with many DNS tools,

http://codeflux.com/tools/

Type any address and select tools, click apply.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Muthukumar_5
Honored Contributor

Re: advantage of dig compared to nslookup

dig is not a default tool available with hp-ux.

Refer this for difference:

http://www.unix.org.ua/orelly/networking_2ndEd/dns/ch12_01.htm

--
Muthu
Easy to suggest when don't know about the problem!
Muthukumar_5
Honored Contributor

Re: advantage of dig compared to nslookup

dig is having functionalties compared to nslookup. dig is having lots of options and configuration changes to query dns informations. nslookup is basic tool to query dns informations.

HP-UX dig is available as,

http://hpux.connect.org.uk/hppd/hpux/Networking/Admin/dig-2.0/

--
Muthu
Easy to suggest when don't know about the problem!
Arunvijai_4
Honored Contributor

Re: advantage of dig compared to nslookup

Shiv, "dig" is available on default in 11.23

# which dig
/usr/bin/dig
# what /usr/bin/dig
/usr/bin/dig:
Copyright (C) 1995-1998 Eric Young.All rights reserved.
$Revision: 1.0 $ Fri Feb 6 00:04:09 GMT 2004
dig/host 1.51/1.29 Fri Feb 6 00:04:09 GMT 2004
$Revision: B11.23.0409LR


It is part InternetSrvcs.INETSVCS2-RUN: /usr/bin/dig

http://docs.hp.com/en/B3921-90010/dig.1M.html

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Yogeeraj_1
Honored Contributor

Re: advantage of dig compared to nslookup

hi,

Compared with nslookup, in the "Domain Information Groper" (dig) you specify all aspects of the query you'd like to send on the command line; there's no interactive mode. You specify the domain name you want to look up as an argument, and the type of query you want to send (e.g., a for address records, mx for MX records) as another argument; the default is to look up address records. You specify the name server you'd like to query after an "@." You can use either a domain name or an IP address to designate a name server. The default is to query the name servers in resolv.conf.

dig is smart about arguments, too. You can specify the arguments in any order you like, and dig will figure out that mx is probably the type of records, not the domain name, you want to look up

the url below talks more about the DIG:

http://www.unix.org.ua/orelly/networking_2ndEd/dns/ch12_09.htm


hope this helps too!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Indira Aramandla
Honored Contributor

Re: advantage of dig compared to nslookup

Hi Shivkumar,

nslookup, dig, dnsquery, and host, are some of the tools that are used to query DNS servers. These are most commonly used to retrieve basic domain information such as what name goes with what IP address, aliases, or how a domain is organized.

For most purposes, there is not much difference among these programs. Your choice will largely be a matter of personal preference. However, you should be aware that some other programs may be built on top of dig, so be sure to keep it around even if you prefer one of the other tools.

nslookup is a fairly rudimentary DNS tool. It is the most ubiquitous and the most likely to be installed by default. It is even available under Windows. It can be used either in command-line mode or interactively. In command-line mode, you use the name or IP address of interest as an argument:

A much better one is dig (short for Domain Internet Groper). dig shows a breakdown of the complete packet returned from the DNS server.

Many administrators prefer dig to nslookup. While not quite as ubiquitous as nslookup, it is included as a tool with bind and is also available as a separate tool. dig is a command-line tool that is quite easy to use. It seems to have a few more options and, since it is command line oriented, it is more suited for shell scripts. On the other hand, using nslookup interactively may be better if you are groping around and not really sure what you are looking for.

A simple dig provides a lot more information, by default at least, than does nslookup. It begins with information about the name server and resolver flags used. Next come the header fields and flags followed by the query being answered. These are followed by the answer, authority records, and additional records. The format is the domain name, TTL field, type code for the record, and the data field. Finally, summary information about the exchange is included.
You can also use dig to get other types of information. For example, the -x option is used to do a reverse name lookup.




Indira A
Never give up, Keep Trying
Steven E. Protter
Exalted Contributor

Re: advantage of dig compared to nslookup

Shalom Shiv,

Another advantage.

nslookup is considered a security hazard and the standards boards are recommended it be made obsolete and de-supported.

So, its probably time to learn dig.

I also however find the host command quite useful.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Don Mallory
Trusted Contributor

Re: advantage of dig compared to nslookup

The reason nslookup is considered a security hazard is that it lets even non-priviledged users do DNZ zone transfers.

Under many Linux distros it's deprecated and warns you to use dig instead when executed.
Don Mallory
Trusted Contributor

Re: advantage of dig compared to nslookup

The reason nslookup is considered a security hazard is that it lets even non-priviledged users do DNS zone transfers.

Under many Linux distros it's deprecated and warns you to use dig instead when executed.