[PATCH] new applet gethostbyname

ralda at gmx.de ralda at gmx.de
Sun Jul 8 09:34:24 UTC 2012


Hi Eial !

> I thought we've finished the getent vs host discussion.

> > dnsip is an example of a full DNS query program like the host
> > command from bind. My explanation decision was more general, not
> > specific to an implementation.
> doesn't getaddrinfo provides that?

It looks to me, you still mix up some information. Here we talked about
a DNS query program (e.g. host or dnsip) and now you are asking about
the libc function getaddrinfo. I'm not sure if I understand, what are
you asking?

getaddrinfo is a libc function of the same family as gethostbyname.

> > ping ? Does ping use/need a full dns query? As far as I know does
> > ping only use simple ip lookup, and then send out network packages
> > to those addresses (ICMP or UDP) 
> when enabling fancy output in ping, one can see the ip of the pinged
> machine.

Providing the IP address does not mean it contain explicit DNS query
code. The code of ping uses simple IP lookup (that is the libc
function). In addition to showing up that information ping send's out
network packages to measure round trip time. No good candidate, as it
produces extra network traffic if you only want to get your IP address.

> > Currently there is none in Busybox (without parsing of output).
> that is why I've wrote the applet in the first place.

Sure, but there are many people who do not like to clutter the Busybox
binary with many applets that not of wide spread interest or at least
modeled after an widely used upstream package.

So your chance to get a simple applet named 'gethostbyname' into
Busybox is really low. It only gets better, if you hit a wider amount
of users need.


> system 1:
> nslookup skynet
> Server:         10.200.10.20
> Address:        10.200.10.20#53
> 
> Name:   skynet
> Address: 10.200.10.20
> 
> system 2:
> nslookup skynet
> Server:    10.200.10.20
> Address 1: 10.200.10.20 skynet
> 
> Name:      skynet
> Address 1: 10.200.10.20 skynet

You forgot to post the versions of Busybox. Looks to me your System 1
uses an older version of Busybox. As far as I know newer versions of
Busybox corrected / extended the output of nslookup to allow for
multiple addresses.

Harald


More information about the busybox mailing list