Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I wished to run example.com on my local test server (Win XP). For this I was able to setup BIND and configured zones for example.com. The local DNS server and local Apache web server both work well. However when I try example.com on browser it takes me to the original example.com not to the local version.

So what am I missing here? Why can't example.com point to the local version in Apache.

zone record for example.com

$TTL 3h
example.com. IN SOA ns1.example.com. ns2.example.com. (
                          1        ; Serial
                          3h       ; Refresh after 3 hours
                          1h       ; Retry after 1 hour
                          1w       ; Expire after 1 week
                          1h )     ; Negative caching TTL of 1 hour

; Name servers
example.com.  IN NS  ns1.example.com.

; Addresses for the canonical names
localhost      IN A
ns1            IN A
  1. ISC BIND service is running.
  2. Apache is running.
  3. Dig @ example.com - shows expected results.
  4. Changed my primary DNS to
  5. Not using any proxy. Everything works from the same box. Browser, DNS and Apache.

What to do to make local example.com work?

Update: I tried - nslookup example.com got the following response -

;; Got recursion not available from, trying next server

Non-authoritative answer:
Name:   example.com

For nslookup I got -

;; Got recursion not available from, trying next server
;; Got recursion not available from, trying next server

** server can't find NXDOMAIN

For Dig example.com, I got -

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

;example.com.                   IN      A

example.com.            3600    IN      SOA     ns1.example.com. ns2.example.com. 1 10800 3600 604800 3600

;; Query time: 15 msec
;; WHEN: Sat Jul 04 17:05:05 2009
;; MSG SIZE  rcvd: 73
share|improve this question
Typo in the SOA, the second parameter, ns2.example.com in your case, should be a mailbox, for instance hostmaster.example.com. –  bortzmeyer Jul 6 '09 at 7:59

4 Answers 4

up vote 2 down vote accepted

is it possible that your web browser uses some proxy rather then direct internet connection?

probably not - but still worth asking.

what does your windows nslookup say when you fire it up on computer where you use web browser? does it say that is one and only dns server? what happens when you type example.com as query ?

[edit: i'm blind.. this one should fix the problem] add

@ IN A
www IN A

to your bind zone file, change serial number and reload bind.

share|improve this answer
Connects directly to internet. I tried this - nslookup example.com, got the following response - ;; Got recursion not available from, trying next server Server: Address: Non-authoritative answer: Name: example.com Address: –  Arpit Tambi Jul 4 '09 at 11:00
ok - temporarily kick out from your list of dns'es [ if your bind is not accepting recursive queries you'll loose internet access ], then try again nslookup and see if your bind answers nicely. –  pQd Jul 4 '09 at 11:19
I removed, so now just have one primary DNS in TCP/IP settings. The internet still works and now nslookup is showing a very different address in place of (from Internet modem I guess) –  Arpit Tambi Jul 4 '09 at 11:31
I have added Dig example.com response above, if that helps. –  Arpit Tambi Jul 4 '09 at 11:36
yes - but your client computer still uses - for time of the test remove from list of dns servers and point only to your as resolver. –  pQd Jul 4 '09 at 11:54

The DNS server you just installed and configured (BIND) is an authoritative name server. That's fine but you cannot use it as a recursive name server, which is what you did when you "Changed my primary DNS to". Hence, nslookup's screams "Got recursion not available from, trying next server".

An authoritative name server is... authoritative for some domains (here, example.com) but is not a general-purpose resolving server. For that, you need a recursive name server.

Two solutions:

  1. Make your BIND name server recursive for your local machine. (Basically, it means adding a recursion yes; in a view, or being sure that your BIND listens only on local IP addresses.) Note that it is bad practice to have a name server being both recursive and authoritative but, for a personal machine used only for tests, it is not a big deal.

  2. Tell the regular recursive that it must forwards requests for example.com for your machine. I cannot say more, it depends who manages it, what software it runs, etc.

share|improve this answer

I agree with pQd, you may also run a tool such as wireshark to see where it goes wrong.

share|improve this answer
assuming all happens on the same box [ that is apache, dns server and browser run on ] wireshark will not be helpful. under windows - afaik - you cannot sniff on loopback. –  pQd Jul 4 '09 at 10:16
He would be able to be sure that no request goes to a proxy and that no dns request goes outside. –  radius Jul 4 '09 at 10:31
I ran wireshark but was not much helpful as I'm directly connected to the internet. –  Arpit Tambi Jul 4 '09 at 11:40
Running Wireshark for a simple configuration problem is immensely overkill. dig is enough. –  bortzmeyer Jul 6 '09 at 8:00
Yep I agree, but when I posted there were not so many info in the question and we were even sure it was a dns problem. Anyway I'm a network guy and network guys (or me at least) love wireshark to troubleshot things running and server on which they can't connect ;) –  radius Jul 6 '09 at 8:33

If you are using proxy server then for a while disable proxy server and choose connect to internet directly and open example.com. (Do not open www.example.com)

If things work fine with direct connection to Internet option. Then re-enable proxy server and put do not use proxy for;localhost;.example.com;

in firefox or put bypass proxy for,localhost,*.example.com

in Internet Explorer.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.