2

I have a D-Link WiFi extender DAP-1320, and somehow, when it gets plugged in, it enables my Linux box to resolve dlinkap.local to its IP address. I don't have to add anything to /etc/hosts.

In the old days, everything worked out of /etc/hosts and /etc/resolv.conf, but poking around /etc/resolv.conf now, I see "resolver" manages that file, and any changes I make will get overwritten.

I miss the old days of Linux a little bit :)

Anyway, what is the mechanism for a device allowing a network it gets plugged into to recognize it by name? Is a bonjour thing, or UPnP? How does it work?

1
  • What Linux distribution is it? Is “resolver” really what manages the file, or is it “resolvconf”? Dec 26, 2014 at 22:27

2 Answers 2

1

DHCP clients usually send their name to the DHCP server. The name is usually recorded in the lease file, and may be added to the local DNS server as an entry under the default domain. (Some routers will use .local, although .localnet would be more appropriate.) If you have a registered domain consider setting the domain on the router to sub-domain such as lan.example.com.

The .local domain is usually used for auto-discovery. Their are several names used for this service such as mdns, bonjour, and avahi. Modern resolvers will often return names from this service.

Depending on the operating system, you can check for DNS entries using the nslookup or host command. This will only return a value if the name is returned from DNS. The resolver library uses multiple sources including DNS, /etc/hosts, and optionally others including mDNS, NIS, LDAP, and more. On Linux these should be listed in the etc/nsswitch.conf file.

You can check for the avahi-daemon processes with the command ps -ef | grep [a]vahi. The command avahi-resolve --name can be used to lookup fully qualified names using the auto-discovery services.

4
  • But with my modem/router being my DHCP server, don't I have to point something on my linux box at it for it to be queried as a DNS server?
    – Greg Bell
    Feb 19, 2015 at 7:47
  • @GregBell It depends on the distribution. Some distributions use automatic configuration of the resolver configuration. This will include the hooks in the DHCP client to write the DNS server data to a known location and invoke the resolver configuration utility. Otherwise, you need to edit /etc/resolve.conf yourself. When resolv.conf is automatically gernerated, it usually has an warning about editing.
    – BillThor
    Feb 19, 2015 at 17:19
  • Yep, Ubuntu uses 'resolver' - no editing of /etc/resolve.conf. But I'm wondering if I have to point NetworkManager or something else at my router to say "go use this device to resolve".
    – Greg Bell
    Feb 22, 2015 at 7:57
  • @GregBell The resolvconf package handles setting up resolv.conf when DHCP connects. It drops a file in /etc/dhcp/dclient-enter-hooks.d.
    – BillThor
    Feb 22, 2015 at 21:05
0

You can easily check whether it's Multicast DNS (bonjour) by browsing the list of known hosts.

$ avahi-browse -a

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .