2

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.

Mike Tosh
  • 53
  • 6

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
  • 90,425
  • 20
  • 200
  • 267
  • That doesn't really fix the Link-Local name resolution in a DHCP network, it's a workaround that requires DNS and static IPs. Good idea, but not quite what I'm looking for. – Mike Tosh Feb 27 '15 at 14:17
  • @MikeTosh: Whats the output of `grep "^hosts:" /etc/nsswitch.conf`? – heemayl Feb 28 '15 at 13:01
  • @Fabby, setting up a DNS server *is not* the answer to my question. The .local domain is a dynamical environment, and a static DNS is quite the opposite of what I'm trying to accomplish. I can access all of the hosts on my network if I include the .local extension, I'm just looking to figure out if Ubuntu, like Windows and Macs already do, can attempt a ZeroConf lookup using the .local domain if the hostname isn't resolved using other means, such as DNS and /etc/hosts. – Mike Tosh Mar 05 '15 at 13:13
  • @heemayl, this is a clean install of 14.04 so whatever the default setting is should be there, but I will get the answer as soon as I reboot into Linux. (I have Virtualbox set up to give my Linux in a VM too, but my laptop is just too slow to use it) – Mike Tosh Mar 05 '15 at 13:13
  • @MikeTosh: OK, that's WINS... (and not obvious from your original question that you're looking for a dynamic environment) So you need to activate a WINS server on your network. On Ubuntu that is done on the samba server! Do you have samba running??? – Fabby Mar 06 '15 at 14:23
  • The output of the grep is `hosts: files mdns4_minimal [NOTFOUND=return] dns`, and based on a question previously asked [on freedesktop.org](http://lists.freedesktop.org/archives/avahi/2011-June/002041.html) I added mdns4 to the end, and still have to use .local to ping the hosts. – Mike Tosh Mar 08 '15 at 15:11
  • @MikeTosh: Make it as `hosts: files mdns4 mdns4_minimal [NOTFOUND=return] dns` , don't put anything `/etc/hosts` and then try to ping the host. – heemayl Mar 08 '15 at 15:26
  • @heemal, Tried that, doesn't work. Still needs the .local. I found another forum that asked the same question, trying to find out how to make avahi search .local domain, [link to serverfault.com](http://serverfault.com/questions/356378/configure-avahi-nss-mdns-not-to-use-local-suffix-with-hostnames-because-of-issue), but the answer given there is that avahi needs to be recompiled with --enable-search-domains enabled. Grr. – Mike Tosh Mar 20 '15 at 23:48
  • and recompiling source is outside of the time or investment I have to spend on getting Ubuntu to work like Windows for my wife to use. Ugh. – Mike Tosh Mar 20 '15 at 23:50