I'm trying to figure out why nslookup can't find a local host name.
CONFIGURATION I'm trying to setup an authoritative nameserver, working from "DNS and BIND", running bind9, on Debian 5.0, in a chroot "jail". bind seems to start okay, as there are no error messages in syslog. hostname reports "workshop.example.net", hostname -f reports the FQDN as the same. The file /etc/hosts holds a line: "xx.xx.xxx.xx workshop.example.net workshop"
The file /etc/resolv.conf could be a problem; its domain line gets set to an inappropriate value when I reboot. But nslookup still doesn't work after I edit the line to "domain example.net" and restart bind9.
NSLOOKUP OUTPUT nslookup gives the SERVER address of the default name server, but says "can't find workshop: NX domain."
QUERY What could be going wrong here?
Is it possible that the problem is with the registration of the domain's hosts and nameservers? I'm not sure I have the values properly set at the registrar. But I would think that the nslookup should find the address for a local host if I have properly set up bind and the various host and resolv.conf files.
UPDATE Here is the output of dig: Command: dig A @workshop workshop.example.net
; <<>> DiG 9.5.1-P2 <<>> A @workshop workshop.example.net ; (1 server found) ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 11327 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0 ;; QUESTION SECTION: ;workshop.example.net. IN A ;; ANSWER SECTION: workshop.example.net. 3600 IN A 220.127.116.11 ;; AUTHORITY SECTION: example.net. 3600 IN NS workshop.example.net. ;; Query time: 0 msec ;; SERVER: 18.104.22.168#53(22.214.171.124) ;; WHEN: Tue Jul 7 00:25:58 2009 ;; MSG SIZE rcvd: 82
I don't know what I'm looking for here, but the IP address in the ANSWER section is what I would expect.
UPDATE - 2 Okay, this seems to be fixed.
The resolve.conf file now reads as follows:
domain example.net # This was domain members.linode.net #search members.linode.com # Previously, not commented out nameserver 127.0.0.1 # This line added nameserver 126.96.36.199 nameserver 188.8.131.52
This reflects three changes from the not-working state: 1) The domain was previously members.linode.com -- I have changed this to my domain's name, which I guess helps by appending 'example.net' to the end of 'workshop'. 2) I've commented out the search line, which I guess was sending the resolver to the members.linode.com domain to look for "workshop". 3) I've added nameserver 127.0.0.1, which I guess means that the resolver looks first at the local nameserver before going to the others.
I don't fully understand the dig output I'm getting for 'workshop', but I'm going to look at dig before I ask any questions about it.
Many thanks to all who took the trouble to look at this and guess at the problem.