Re: How to get IP address of named host?



On Sat, 25 Feb 2006, Gordon Henderson spake:
[`getent']
I've always used the 'host' command in the past for quick & dirty name
lookup (after nslookup went out of fashion!) Eg:

getent's job is not to do DNS lookups but rather to do lookups using NSS
in exactly the same way the libc would do it.

e.g. on my system:

nix@hades 177 /tmp% getent hosts loki.local
192.168.14.16 loki.local
nix@hades 178 /tmp% getent hosts loki
192.168.14.16 loki.wkstn.nix

The first of these is a lookup through Zeroconf/Avahi: the second is a
lookup via DNS. An /etc/hosts lookup, or a lookup via whatever weird new
protocol you may write NSS modules for, would work in just the same way.

--
`... follow the bouncing internment camps.' --- Peter da Silva
.



Relevant Pages

  • Re: RFC-Ignorant.org (was Re: DISCARDING mail with bogus MX records.)
    ... > DNS lookups, and a real-time lookup is more accurate than a bogusmx lookup. ... Real time bogusmx check *MAY* take long. ...
    (comp.mail.sendmail)
  • Re: [9fans] csipinfo
    ... why should a program in general care what the difference between a domain and an ip address is? ... that's what's the subject of DNS lookups to do a `reverse lookup'. ... because it catches cases where client programs ...
    (comp.os.plan9)
  • Re: [9fans] csipinfo
    ... that's what's the subject of DNS lookups to do a `reverse lookup'. ... it's really an ordinary lookup of specially-constructed names in ...
    (comp.os.plan9)
  • Re: TCPIP: DNS lookup timeouts
    ... > DNS lookups with a vulnerable client I guess. ... > happens with a reverse lookup but with an older client it ...
    (comp.os.vms)