nslookup's Server: 0.0.0.0 but resolves correctly

Steven Honeyman stevenhoneyman at gmail.com
Sat Oct 25 23:38:44 UTC 2014


On 26 October 2014 00:20, Steven Honeyman <stevenhoneyman at gmail.com> wrote:
> On 25 October 2014 23:30,  <stroblsw at gmail.com> wrote:
>>>
>>> $ /usr/local/bin/busybox nslookup example.com
>>> Server:    (null)
>>> Address 1: (null)
>>> Address 2: 127.0.0.1 localhost.localdomain
>>>
>>> Name:      example.com
>>> Address 1: (null)
>>> Address 2: 93.184.216.119
>>
>> okay, it's not just bionic but musl too.
>>
>> the musl resolution looks particularly evil with address1 being null.
>> I didn't dare to suggest this before but if musl was trying to resolve
>> the IPv6 address there to null then maybe this bug is related to
>> ENABLE_FEATURE_IPV6
>
> Hmm, maybe the opposite?
>
> $ /usr/local/bin/busybox bbconfig | grep IPV6
> # CONFIG_FEATURE_IPV6 is not set
> # CONFIG_FEATURE_IFUPDOWN_IPV6 is not set
> $ /usr/bin/busybox bbconfig | grep IPV6
> CONFIG_FEATURE_IPV6=y
> CONFIG_FEATURE_IFUPDOWN_IPV6=y
>
> <change config and recompile musl version>
>
> $ ./busybox-ipv6 nslookup example.com
> Server:    (null)

Oh... I just had a look at the source(s)... here is what doesn't look promising:

busybox:

 35  * This applet is the only user of res_init(). Without it,
 36  * you may avoid pulling in _res global from libc.

126         sa = (struct sockaddr*)&_res.nsaddr_list[0];
127     server = xmalloc_sockaddr2dotted_noport(sa);

musl:

 24
 25 /* unused; purely for broken apps */
 26 typedef struct __res_state {
 27     int retrans;


More information about the busybox mailing list