Fake domain doesn’t resolve when offline

domain-name-systemlocalhostpowerdns

I have a flimsy grasp of DNS. Nonetheless, in order to install a local development copy of WordPress MU, I needed to create a fake domain, which I called local.dev. It and all subdomains simply resolve to 127.0.0.1. Apache then directs to the correct folder.

I installed PowerDNS, and got it working properly with a MySQL backend. I didn't feel comfortable, but since it worked, I didn't ask any more questions. The bizarre thing is it requires an internet connection to resolve correctly, and now I need to use it offline.

If I am offline, Chrome provies the error:

Error 105 (net::ERR_NAME_NOT_RESOLVED): The server could not be found.

/etc/hosts

127.0.0.1 localhost

/etc/resolv.conf

nameserver 127.0.0.1
nameserver 8.8.8.8
nameserver 8.8.8.4

When I dig, I get the same thing, on or offline:

dig local.dev

; <<>> DiG 9.6.1-P2 <<>> local.dev
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10635
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

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

;; ANSWER SECTION:
local.dev.      120 IN  A   127.0.0.1

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu Apr 22 15:32:51 2010
;; MSG SIZE  rcvd: 43

nslookup doesn't find local.dev in either case

nslookup local.dev
;; Got recursion not available from 127.0.0.1, trying next server
;; Got recursion not available from 127.0.0.1, trying next server
Server:     8.8.8.8
Address:    8.8.8.8#53

** server can't find local.dev: NXDOMAIN

PowerDNS config (comments removed):

allow-recursion=127.0.0.1
allow-recursion-override=on

If you need more information, I am happy to provide it.

Best Answer

It sounds like you either need an local hosts entry for your DNS server, or your PowerDNS is set to resolve addresses externally before checking its internal database.

Related Topic