LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Getting DNS to work on my Linux Server (https://www.linuxquestions.org/questions/linux-newbie-8/getting-dns-to-work-on-my-linux-server-739375/)

mikemillion 07-11-2009 08:03 AM

Getting DNS to work on my Linux Server
 
In /var/log/messages:

Jul 11 08:57:52 babylon named[1221]: starting BIND 9.2.2 -u named
Jul 11 08:57:52 babylon named[1221]: using 2 CPUs
Jul 11 08:57:52 babylon named[1221]: loading configuration from '/etc/named.conf'
Jul 11 08:57:52 babylon named: named startup succeeded
Jul 11 08:57:52 babylon named[1221]: no IPv6 interfaces found
Jul 11 08:57:52 babylon named[1221]: listening on IPv4 interface lo, 127.0.0.1#53
Jul 11 08:57:52 babylon named[1221]: listening on IPv4 interface eth0, 172.20.184.100#53
Jul 11 08:57:52 babylon named[1221]: listening on IPv4 interface eth1, 192.168.15.100#53
Jul 11 08:57:52 babylon named[1221]: command channel listening on 127.0.0.1#953
Jul 11 08:57:52 babylon named[1221]: zone 184.20.172.in-addr.arpa/IN: loading master file 172.20.184.zone: file not found
Jul 11 08:57:52 babylon named[1221]: zone pvisions.com/IN: loading master file pvisions.zone: file not found
Jul 11 08:57:52 babylon named[1221]: running



But attempting an nslookup:

-bash-2.05b# nslookup
Note: nslookup is deprecated and may be removed from future releases.
Consider using the `dig' or `host' programs instead. Run nslookup with
the `-sil[ent]' option to prevent this message from appearing.
> magnum
Server: 127.0.0.1
Address: 127.0.0.1#53

** server can't find magnum: NXDOMAIN
> exit



Then a host command:

-bash-2.05b# host magnum
Host magnum not found: 3(NXDOMAIN)

Any suggestions???

bathory 07-11-2009 08:24 AM

Hi,
If you want to be able to resolve hostnames without using FQDN, you have to add "domain domain.com" or "search domain.com" in /etc/resolv.conf
Quote:

Jul 11 08:57:52 babylon named[1221]: zone 184.20.172.in-addr.arpa/IN: loading master file 172.20.184.zone: file not found
Jul 11 08:57:52 babylon named[1221]: zone pvisions.com/IN: loading master file pvisions.zone: file not found
Check 1)the beginning of named.conf for the "directory ..." option and 2)the zone definitions for the "file ..." option and make sure that the zone files are where they supposed to be.

mikemillion 07-11-2009 08:42 AM

using directory and file options got me further
 
Jul 11 09:34:26 babylon named[2939]: starting BIND 9.2.2 -u named
Jul 11 09:34:26 babylon named[2939]: using 2 CPUs
Jul 11 09:34:26 babylon named[2939]: loading configuration from '/etc/named.conf'
Jul 11 09:34:26 babylon named[2939]: no IPv6 interfaces found
Jul 11 09:34:26 babylon named[2939]: listening on IPv4 interface lo, 127.0.0.1#53
Jul 11 09:34:26 babylon named[2939]: listening on IPv4 interface eth0, 172.20.184.100#53
Jul 11 09:34:26 babylon named[2939]: listening on IPv4 interface eth1, 192.168.15.100#53
Jul 11 09:34:26 babylon named[2939]: command channel listening on 127.0.0.1#953
Jul 11 09:34:26 babylon named[2939]: dns_rdata_fromtext: 172.20.184.zone:9: near 'babylon.pvisions.com..': empty label
Jul 11 09:34:26 babylon named[2939]: zone 184.20.172.in-addr.arpa/IN: loading master file 172.20.184.zone: empty label
Jul 11 09:34:26 babylon named[2939]: zone pvisions.com/IN: has no NS records
Jul 11 09:34:26 babylon named[2939]: running
Jul 11 09:34:26 babylon named: named startup succeeded

However, trying to perform a lookup:

-bash-2.05b# host magnum
Host magnum not found: 3(NXDOMAIN)
-bash-2.05b# host magnum.pvisions.com
Host magnum.pvisions.com not found: 2(SERVFAIL)

stureedy 07-11-2009 08:54 AM

Greetings,

I use dnsmasq for name services on my home server. It seems much easier to configure than bind and will resolve names using the server's /etc/hosts file.

For my use, the default config file just works. I add all the machines for which I want local names to /etc/hosts:

192.168.37.11 thisbox.example.com thisbox
192.168.37.11 thatbox.example.com thatbox

Then, on my local machines, I make /etc/resolv.conf something like:

search example.com
nameserver server.example.com

This setup has worked for many years on my about-to-be-retired Slackware 10.2 box. It even works on our non-Linux machines, as I told the router that the first DNS server is server.example.com -)

For more info, see:
http://www.thekelleys.org.uk/dnsmasq/doc.html

Hope that helps!

bathory 07-11-2009 09:01 AM

Quote:

Jul 11 09:34:26 babylon named[2939]: zone pvisions.com/IN: has no NS records
This means that you don't have a NS record in your zone file:
Code:

    NS  ns.pvisions.com.

ns  A    172.20.184.100

For the reverse zone (184.20.172.in-addr.arpa) you should post the zone file to see what's wrong with it.

mikemillion 07-12-2009 12:48 PM

Voila! My DNS server is up and running, lookups working normally, now I can actually move on to some application installs...

Thank you to everyone that offered up suggestions, as I used them all!


All times are GMT -5. The time now is 10:28 PM.