3

So in windows, if I typed ping familyroom, it would tell me that my PC in the family room is 192.168.1.61. (DHCP assigned address that isn't in any DNS)

I'm running a new install of Ubuntu 14.04 Trusty Tahr LTS, and if I try to ping familyroom, I get unknown host. But, if I try to ping familyroom.local, I get a successfully response from that same IP address.

now I realize that I can just use the FQDN including the .local domain, but I'm lazy, and I'm trying to get Ubuntu 14.04 to work as well as Windows 7 did for me, and this is just one more nit-picky thing that irks me.

As a test, I added a search local to a new /etc/resolvconf/resolve.conf.d/tail file and resolvconf -u, but I get the same result. I assume this is due to "zeroconf" doing the name resolution for .local, but I don't know where to go from here to fix.


EDIT: Based on the help from @heemal, I now realize that Link Local resolution comes from Avahi, so I am focused on trying to get the Avahi name resolution to look up short-named hosts, or find an alternative to Avahi.

In the /etc/nsswitch.conf file, I attempted to add the full MDNS functionality of Avahi for DNS not found addresses.

Original hosts definition: `hosts: files mdns4_minimal [NOTFOUND=return] dns`
Unchanged results using: `hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4`

Now in Windows, I see that this Link Local resolution is coming via IPv6, and I wonder if there are improvements in the specification for IPv6 that could help me out here.

1 Answers1

1

If you add something on /etc/resolvconf/resolve.conf.d/{head, base, tail} then the name resolution will be carried out by resolvconf, not by avahi-daemon hence just adding search local is not resolving the name.

To get the search domain working you need to set up a DNS server that will give response to your queries after the domain name being appended properly by your system.

Another option would be to add the entries in your /etc/hosts file like:

familyroom    192.168.1.4

Now if you ping familyroom you will get the response.

By far the laziest option would be to add an alias like this:

alias familyroom='ping familyroom.local'

in the ~/.bashrc file. Now source ~/.bashrc and you can just type familyroom to send the ICMP echo request to the device.

heemayl
  • 93,925