LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   DNS with bind9 on Debian: won't resolve (zone file error?) (http://www.linuxquestions.org/questions/linux-software-2/dns-with-bind9-on-debian-wont-resolve-zone-file-error-902142/)

rrije 09-09-2011 09:32 AM

DNS with bind9 on Debian: won't resolve (zone file error?)
 
Hello,

I'm trying to configure a local dns server which would be responsible for resolving names inside the local network.
I have followed the howto here and managed to get bind9 up and running; the name resolution won't work though. Seems to me there are mistakes in the zone file. The file in question:
Code:

$TTL    604800
@      IN      SOA    nexus.homeworld.local. tech.homeworld.local. (
;
                            2012090901        ; Serial
                                  7200        ; Refresh
                                  120        ; Retry
                              2419200        ; Expire
                                604800)        ; Default TTL
;
@      IN      NS      nexus.homeworld.local.
server                  IN      A      192.168.0.10
machine-mother          IN      A      192.168.0.2
router                  IN      A      192.168.0.1

And nslookup output:
Code:

[tech@server]$ nslookup machine-mother
Server:                192.168.0.10
Address:        192.168.0.10#53

** server can't find machine-mother: NXDOMAIN

What might be the problem here?

Thanks,
rrije.

bathory 09-09-2011 02:55 PM

Hi,

You need to add either one of the following in /etc/resolv.conf, if you want to be able to resolve hosts without giving the FQDN
Code:

domain homeworld.local
search homeworld.local

That be said, you have also an error in the zone file. You don't have an A record for the NS (nexus.homeworld.local).
So add:
Code:

nexus IN A 192.168.0.10
in the zone file, increase the serial and reload the zone.

Regards

rrije 09-10-2011 08:14 AM

Thanks for the reply,
Seems it really was the missing "domain" parameter in the resolv.conf.
If someone needs it, here is the working configuration -- resolv.conf:
Code:

domain homeworld.local
search homeworld.local
nameserver 192.168.0.10
nameserver 192.168.0.1

and zone file:
Code:

$TTL    604800
@      IN      SOA    server.homeworld.local. tech.homeworld.local. (
;
                            2012090902        ; Serial
                                  7200        ; Refresh
                                  120        ; Retry
                              2419200        ; Expire
                                604800 )      ; Default TTL
;
                        IN      NS      server.homeworld.local.
machine-mother          IN      A      192.168.0.2
server                  IN      A      192.168.0.10
nexus                  IN      CNAME  server
router                  IN      A      192.168.0.1

On a side note, it does pay off having a machine w/o graphical environment. Configuring all this stuff in openSuSe via the GUI was easy, but... uninspiring. During these two days I've learned more about DNS than in the past two years.

Anyway, thanks again.
Sincerely yours, rrije.

bathory 09-10-2011 08:59 AM

Glad to see it worked.
As a side note, better use only one of the domain or search options in resolv.conf. From the resolv.conf manpage:
Quote:

The domain and search keywords are mutually exclusive. If more than one instance of these keywords is
present, the last instance wins.
Regards


All times are GMT -5. The time now is 08:24 PM.