azukiapp / libnss-resolver

A Linux extension that adds support to the /etc/resolver/[suffix].
Apache License 2.0
44 stars 12 forks source link

Make sure to initialize options struct and make 53 the default DNS server port. #8

Open petterreinholdtsen opened 8 years ago

petterreinholdtsen commented 8 years ago

This should address issue #4.

fearenales commented 8 years ago

@petterreinholdtsen I wasn't able to make this work. I used Ubuntu 14.04 in my tests.

I installed libnss-resolver from your branch, and set the /etc/resolver/test.resolver file as the following:

# /etc/resolver/test.resolver
nameserver 127.0.0.1

Since the port is not defined, libnss-resolver should assume 53.

Then I started dnsmasq:

sudo dnsmasq --bind-interfaces -p 53 --no-daemon --address=/test.resolver/127.0.0.1

Then I tried to ping it:

$ ping test.resolver
ping: unknown host test.resolver

Specifying the port in the /etc/resolver/test.resolver file:

# /etc/resolver/test.resolver
nameserver 127.0.0.1:53

And trying to ping:

$ ping test.resolver
PING test.resolver (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.018 ms

I'm missing something? How did you do your tests?

petterreinholdtsen commented 2 years ago

I no longer remember, I must admit. :)