Question

I'm really struggling with dnsmasq setup.

My dnsmasq config contains (amongst other things), the following

address=/local/127.0.0.1
listen-address=127.0.0.1
domain=local

My network manager conf and resolve conf are definitely including 127.0.0.1 as the first nameserver.

If I run

dig mysite.local

I get

; <<>> DiG 9.8.1-P1 <<>> mysite.local
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 61359
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;mysite.local.          IN  A

;; ANSWER SECTION:
mysite.local.       0   IN  A   127.0.0.1

;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue Dec 17 10:33:40 2013
;; MSG SIZE  rcvd: 46

(Yes, mysite.local is an apache vhost listening on port 80).

However, if I browse or wget to mysite.local, I get:

--2013-12-17 10:35:49--  http://mysite.local/
Resolving mysite.local (mysite.local)... failed: Name or service not known.
wget: unable to resolve host address `mysite.local'

Running Ubuntu 12.04. Tailing the output of syslog with dnsmasq debugging on indicates that neither wget or a browser ever queries dnsmasq for the .local domains, but running dig on a .local domain works fine.

Any thoughts much appreciated.

Was it helpful?

Solution

Think a colleague may have found the answer to this.

It appears (although happy to be corrected on this) that Linux reads '.local' as a synonym for 'localhost'. This seems to be what was leading to the bypass of dnsmasq.

The solution was to pick a different fake top level domain. I went for '.dev' in the end, and everything worked fine!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top