[Dnsmasq-discuss] 2.53rc2

Simon Kelley simon at thekelleys.org.uk
Thu May 27 21:08:31 BST 2010


clemens fischer wrote:
> Matthias Andree wrote:
> 
>> Assuming Linux or one of the supported BSDs, try:
>>
>> strace -e trace=network dnsmasq -d [other dnsmasq options]
>>
>> Other systems might provide truss or ktrace/kdump.
> 
> So I followed this advice and made the following discoveries:
> 
> 2010-05-27_16:07:11.46459 + exec strace -f -e \
>   trace=network /usr/local/sbin/dnsmasq -C /etc/dnsmasq.conf \
>   -u nobody -g nobody -q --log-dhcp --log-facility=- \
>   --log-async=0 -k --rebind-domain-ok=/zen.spamhaus.org/ \
>   --rebind-domain-ok=/dnsbl-1.uceprotect.net/ \
>   --rebind-domain-ok=/ix.dnsbl.manitu.net/ --rebind-localhost-ok
> 2010-05-27_16:07:11.53129 socket(PF_NETLINK, SOCK_RAW, 0)         = 3
> 2010-05-27_16:07:11.53151 bind(3, {sa_family=AF_NETLINK, pid=0,
>   groups=00000440}, 12) = 0
> 2010-05-27_16:07:11.53166 getsockname(3, {sa_family=AF_NETLINK,
>   pid=10011, groups=00000440}, [12]) = 0
> 
> I wonder what netlink is used for?  Could it be DBus?  Quite a bit of
> traffic on the netlink socket.

Mainly, it's finding all the interfaces and their parameters, there's
also a function which listens for an "interface up" event and re-send
the last query, to make dial-on-demand work better.

> 
> ...
> 2010-05-27_16:07:11.54045 socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 7
> 2010-05-27_16:07:11.54059 setsockopt(7, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
> 2010-05-27_16:07:11.54073 bind(7, {sa_family=AF_INET,
>   sin_port=htons(53), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE
>   (Address already in use)
> 2010-05-27_16:07:11.54092
> 2010-05-27_16:07:11.54110 dnsmasq: failed to create listening
>   socket: Address already in use
> 
> So I presume nothing can be done if people want to wildcard-bind in
> order to use any interfaces, even when they don't exist yet.

Can you make BIND listen on a port other than 53, and direct queries to
it through dnsmasq (dnsmasq will send queries upstream on any port you
like).

> 
> 2010-05-27_16:07:11.54204 socket(PF_FILE, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 8
> 2010-05-27_16:07:11.54225 connect(8, {sa_family=AF_FILE,
>   path="/dev/log"}, 110) = 0
> 2010-05-27_16:07:11.54241 send(8, "<26>May 27 18:07:11
>   dnsmasq[1001"..., 93, MSG_NOSIGNAL) = 93
> 2010-05-27_16:07:11.54264 send(8, "<26>May 27 18:07:11
>   dnsmasq[1001"..., 54, MSG_NOSIGNAL) = 54
> 
> This is a little disturbing:  logging is configured to go to a file
> (stderr), not to syslog.  It doesn't make much difference here, though.



More information about the Dnsmasq-discuss mailing list