# Simple DNS question

## offline

What command line tool can be used to do a DNS lookup?  i thought i read that it was "dig" but that got me nowhere...

----------

## pjp

I thought it was nslookup, but it isn't installed on my machine.

----------

## offline

i noticed that myself.  Hence the question  :Smile: 

----------

## pjp

emerge -s nls doesn't return anything helpful.  I'm guessing it is burried 

in some package.  A shame emerge -S doesn't search inside packages.

----------

## delta407

nslookup (and dig also, IIRC) are installed as part of "bind-tools".

----------

## Scott Frappier

 *Quote:*   

> 
> 
> What command line tool can be used to do a DNS lookup? i thought i read that it was "dig" but that got me nowhere...
> 
> 

 

Do the following:

1.) emerge bind-tools

dig, host, nslookup, and a couple other things should now be available for use.  

Have fun!

Scott Frappier

----------

## mglauche

nslookup seems to be fading away, at least on the newer BIND variats i allways get a deceperation meesage, and that i should use dig instead   :Evil or Very Mad: 

Think i have to check if djb-dns has a nslookup tool  :Wink: 

(oh, there is even an ebuild for djbdns ! cool !)

----------

## cyc

dig is the new version included since BIND 9 i think. nslookup also gives a notice about that i think. It says you should use dig

----------

## klieber

dig gives a lot more information than nslookup does -- it's rightfully supplanting nslookup as the DNS swiss army knife of choice.

BTW, the word is "deprecated"  :Smile: 

--kurt

----------

## delta407

Bah, I still like nslookup more.

----------

## offline

Is there any way to make dig return ONLY the ip address?

----------

## klieber

I don't believe so, but:

```
man dig
```

would probably answer your question...

--kurt

----------

## mrchuckles

 *delta407 wrote:*   

> Bah, I still like nslookup more.

 

Then you must not maintain any DNS servers for a living.  dig is a dream compared to nslookup.  I can basically view and troubleshoot an entire zone file from the command line.    :Smile: 

----------

## Xamot

 *mglauche wrote:*   

> nslookup seems to be fading away, at least on the newer BIND variats i allways get a deceperation meesage, and that i should use dig instead  
> 
> Think i have to check if djb-dns has a nslookup tool 
> 
> (oh, there is even an ebuild for djbdns ! cool !)

 

djb-dns lookup tools:  dnsip(1), dnsipq(1),   dnsname(1),  dnsmx(1),  dnstxt(1),  dnsqr(1), dnsq(1), dnstrace(1)

dnsip takes a fqdn and retruns just an IP.Last edited by Xamot on Fri Jul 12, 2002 5:01 pm; edited 1 time in total

----------

## Nitro

 *offline wrote:*   

> Is there any way to make dig return ONLY the ip address?

 

What do you mean? Only A records?  Not at all.  Try: 

```
dig MX gentoo.org 

dig NS gentoo.org
```

----------

## klieber

 *Xamot wrote:*   

> dnsip takes a fqdn and retruns just an IP.

 

You mean, like ping?  :Laughing: 

--kurt

----------

## Matt2000

 *Nitro wrote:*   

>  *offline wrote:*   Is there any way to make dig return ONLY the ip address? 
> 
> What do you mean? Only A records?  Not at all.  Try: 
> 
> ```
> ...

 

I think

```
host www.gentoo.org
```

is what he means =)[/code]

----------

