Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
dns lookup command
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Woody
Guru
Guru


Joined: 30 Nov 2002
Posts: 592
Location: Milwaukee

PostPosted: Fri May 23, 2003 6:56 pm    Post subject: dns lookup command Reply with quote

Hi, I used to use nslookup for resolving hosts from the shell, but I know
its been replaced by something else. In fact, I just discovered it the other
day, but I've forgotten the command. Can someone remind me? ta.
Back to top
View user's profile Send private message
compu-tom
Guru
Guru


Joined: 09 Jan 2003
Posts: 415
Location: Berlin, Germany

PostPosted: Fri May 23, 2003 6:57 pm    Post subject: Reply with quote

It is
Code:
host myhostname
Back to top
View user's profile Send private message
Naan Yaar
Bodhisattva
Bodhisattva


Joined: 27 Jun 2002
Posts: 1549

PostPosted: Fri May 23, 2003 7:19 pm    Post subject: Reply with quote

dig(1) and host(1).
Back to top
View user's profile Send private message
Woody
Guru
Guru


Joined: 30 Nov 2002
Posts: 592
Location: Milwaukee

PostPosted: Fri May 23, 2003 7:57 pm    Post subject: Reply with quote

I don't have either dig or host installed. I know there was something else.
Well, I'll just install one of these.
Back to top
View user's profile Send private message
compu-tom
Guru
Guru


Joined: 09 Jan 2003
Posts: 415
Location: Berlin, Germany

PostPosted: Fri May 23, 2003 7:58 pm    Post subject: Reply with quote

They are both in net-dns/bind-tools.
Back to top
View user's profile Send private message
Regor
Guru
Guru


Joined: 06 Aug 2002
Posts: 545
Location: 39° 2' 48" N, 120° 59' 2" W

PostPosted: Sat May 24, 2003 10:43 am    Post subject: Reply with quote

Totally off topic:

Nice avatar. "This machine kills fascists" would be a good sticker on the side of a linux box too :)
_________________
Sometimes the appropriate response to reality is to go insane.
-Philip K. Dick, Valis
Back to top
View user's profile Send private message
nuke
n00b
n00b


Joined: 14 Sep 2003
Posts: 30

PostPosted: Wed Sep 24, 2003 4:24 am    Post subject: Reply with quote

It would be really good if the above package turned up when I did

emerge search dig

I couldn't believe that Gentoo didn't have at least one of nslookup/dig.

Oh well, at least folks here knew :-)
Back to top
View user's profile Send private message
delta407
Bodhisattva
Bodhisattva


Joined: 23 Apr 2002
Posts: 2876
Location: Chicago, IL

PostPosted: Wed Sep 24, 2003 4:47 am    Post subject: Reply with quote

nuke wrote:
It would be really good if the above package turned up when I did

emerge search dig
My little-known search Portage by description script works wonderfully here. ;-)
_________________
I don't believe in witty sigs.
Back to top
View user's profile Send private message
BitJam
Advocate
Advocate


Joined: 12 Aug 2003
Posts: 2508
Location: Silver City, NM

PostPosted: Wed Sep 24, 2003 6:20 am    Post subject: Reply with quote

Try:
Code:
# emerge -S dig


This takes a long time. You may want to
Code:
# ACCEPT_KEYWORDS="~x86" emerge esearch
# eupdatedb
# esearch -S dig


I've put eupdatedb in my crontab.
Back to top
View user's profile Send private message
_integralpanther_
n00b
n00b


Joined: 13 Jul 2005
Posts: 7
Location: de

PostPosted: Fri Jan 27, 2023 6:28 am    Post subject: dns lookup command Reply with quote

Hi everyone,

this thread is quiet old but in case anyone still looks for a common method without installing additional programs:

Code:
getent hosts myhostname


should do the job. At least on my gentoo box.
Just make sure that your /etc/nsswitch.conf contains something like (see man getent):
Code:
hosts:      files dns
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3131

PostPosted: Fri Jan 27, 2023 4:43 pm    Post subject: Reply with quote

Getent surely is handy, but it's not the same as nslookup.
nslookup can find records of arbitrary types published on DNS and ignores any sources that are not dns.
Getent shows the IP address that would be handed to the application when resolving names, so A and AAAA entries coming from the configured sources. Including /etc/hosts and mdns if yoursystem is set to use it.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum