0

I have a strange issue with my Ubuntu box. The hostname git resolves to the proper IP address (according to ping it resolves to git.example.local). If I try to resolve git.example.local itself, then it doesn't work. The ping utility is used to determine if the host can be resolved.

When I type nslookup git.example.local, then it resolves to the proper IP address. All external hostnames (i.e. askubuntu.com) are resolved properly. My /etc/resolv.conf looks like:

nameserver 127.0.1.1
search example.local

If I modify example.local to something else, then git doesn't resolve anymore. Can anyone tell me what's wrong?

2 Answers 2

3

Microsoft uses .local as the recommended root of internal domains, and serves them via unicast dns. Linux uses .local as the root of multicast dns. If you're stuck on a broken MS network like this, reconfigure your linux multicast DNS to use a different domain like .alocal.

To do this, add a domain-name=.alocal line to the [server] section of /etc/avahi/avahi-daemon.conf, then restart avahi-daemon: sudo service avahi-daemon restart.

[server]
domain-name=.alocal

You may need to flush the DNS, mDNS and resolver cache, as well as restart your web browsers to clear their internal cache.

Credits go to this blog entry that also has some more background information. I have included the solution for quick reference.

-1

No the .local has no conflicts, DNS is DNS, the problem is "not found" is set in nsswitch.conf before "dns"

WRONG!

/etc/nsswitch.conf : hosts: files mdns4_minimal [NOTFOUND=return] dns

that [NOTFOUND...] is what was happening with any FQDN using localdomain.local or whatever you had.

Justs move the "dns" resolution type after files, where it should be, same as an ubuntu server LTS.

I don't even know why you need [NOTFOUND..] if not using other types of resolution, I can't say for sure that the NOTFOUND directive isn't also in some other Linix distros but I can say "dns" is never after it like it was here, I think it's bug.

This fixes it and no restarting of anything is required.

RIGHT or more RIGHT than before

/etc/nsswitch.conf : hosts: files dns mdns4_minimal [NOTFOUND=return]

And this is how a fresh install of ubuntu server looks, latest LTS version.

/etc/nsswitch.conf : hosts: files dns

Some people think nsswitch.conf is a file of the past, it just typically need know modification but it's still as critical as it's always been.

FYI, I don't know about you but on my install I didn't select or choose any non-standard or extra resolution or authentication types such as Kerberos, AD, NIS, LDAP, etc, really it was just the default install of Ubuntu Desktop LTS.

5
  • 1
    Do you understand what NOTFOUND=return and mdns4_minimal mean?
    – muru
    Sep 20, 2017 at 4:04
  • Yes, do you understand why they don't exist by default on Ubuntu Server? Sep 21, 2017 at 12:42
  • obvious: desktops can be expected to be in a network with multicast services, unlike servers, and server users can be expected to know how to configure the serves to use multicast if needed. Your post, however, shows no understanding of either.
    – muru
    Sep 21, 2017 at 12:45
  • You said it was it a multicast problem, it wasn't, you suggested a fix in the conf of avahi-daemon wrong again, I forget you invent the algorithm for the google search engine back in 1997, no, that wasn't you? You said Microsoft uses .local, nope it's something they recommend in test Active Directory domains a very long time ago, it was an example, they don't use a default top level domain. I fix the issue and bring the system closer industry standards and some loser votes me down. Muru, I'm sure a riot on twitter too but not with the ladies, am I right? Sep 21, 2017 at 12:56
  • 1
    comments removed. Ask Ubuntu has a strict Be Nice policy. Please follow it.
    – Seth
    Sep 21, 2017 at 17:23

You must log in to answer this question.

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