LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-09-2005, 12:28 PM   #1
xemous
Member
 
Registered: Jun 2004
Posts: 80

Rep: Reputation: 15
DNS issues with BIND


I'v got some problems with my DNS server.

Ok first question, how do I change my host name.

This is what i get when I run host localhost
Code:
[root@localhost root]# host localhost
localhost.vic.bigpond.net.au has address 127.0.0.1
I am thinking that localhost.vic.bigpond.net.au is my hostname?

This is whats in the /etc/resolv.conf
Code:
[root@localhost root]# more /etc/resolv.conf
nameserver 61.9.128.14
nameserver 61.9.192.15
search vic.bigpond.net.au
If i change the vic.bigpond.net.au to anything else it fails;
Such as xemous.net (my test domain) i get this:
Code:
[root@localhost root]# host localhost
Host localhost not found: 3(NXDOMAIN)
The hosts file is this:
Code:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain    localhost
Ok now this is the DNS stuff which isnt working, probably due to the above problems

The named.conf
Code:
// generated by named-bootconf.pl

options {
        directory "/var/named";
        /*
         * If there is a firewall between you and nameservers you want
         * to talk to, you might need to uncomment the query-source
         * directive below.  Previous versions of BIND always asked
         * questions using port 53, but BIND 8.1 uses an unprivileged
         * port by default.
         */
        // query-source address * port 53;
};

//
// a caching only nameserver config
//
controls {
        inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
        type hint;
        file "named.ca";
};

zone "localhost" IN {
        type master;
        file "localhost.zone";
        allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
        type master;
        file "named.local";
        allow-update { none; };
};

zone "xemous.net" {
        type master;
        file "xemous.net.db";
};

zone "1.168.192.in-addr.arpa" {
        type master;
        file "xemous.net.rev";
};

include "/etc/rndc.key";
And the /var/named/xemous.net.db file:
Code:
 
$TTL 604800
xemous.net.                     IN      SOA     localhost.xemous.net.   hostmaster.xemous.net. (
                                2005011000      ;serial number
                                10800           ;refresh rate in secounds (3 hours)
                                1800            ;retry rate in secounds (30 minutes)
                                1209600         ;expire in seconds (2 weeks)
                                604800  )       ;minimum in secounds (1 week)

                        IN      NS      61.9.128.14
                        IN      NS      61.9.192.15

xp                      IN      A       192.168.0.187
gn                      IN      A       192.168.0.121
sw                      IN      A       192.168.0.194

x                       IN      CNAME   192.168.0.187
And the /var/named/xemous.net.rev file
Code:
$TTL 604800
xemous.net.             IN      SOA     1.168.192.in-addr.arpa. hostmaster.xemous.net. (
                                2005011001      ;serial
                                10800           ;refresh rate (3 hours)
                                1800            ;retry (30 minutes)
                                1209600         ;expire (2 weeks)
                                604800 )        ;minimum (1 week)

                IN      NS      61.9.128.14
                IN      NS      61.9.192.15

187             IN      PTR     xp.xemous.net.
121             IN      PTR     sq.xemous.net.
194             IN      PTR     gn.xemous.net.
I ran a ps -C named
and then kill -HUP the lowest PID on the list to commit the changes.

I can still ping google.com but whenever I try say; xp.xemous.net which should ping to 192.168.0.187, I get an unkown host.
By the way, the system is Redhat 7.3 running on vmware.
I'm not sure on what version BIND is.
Please help!
 
Old 01-09-2005, 02:04 PM   #2
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
host localhost will search through a dns server, that 's not good

try :
hostname

...to know your hostname,

I saw some configuration problem, if you want your dns just for your lan, try these changes :
(i call your dns server hostname "myhost" and say its IP is : 192.168.0.1)

- in named.conf :
Code:
options {
        directory "/var/named";
        /*
         * If there is a firewall between you and nameservers you want
         * to talk to, you might need to uncomment the query-source
         * directive below.  Previous versions of BIND always asked
         * questions using port 53, but BIND 8.1 uses an unprivileged
         * port by default.
         */
        // query-source address * port 53;
         forwarders {
                61.9.128.14;
                61.9.192.15;
        };
};
- in the /var/named/xemous.net.db file :
Code:
$TTL 604800
xemous.net.                     IN      SOA     myhost.xemous.net.   hostmaster.xemous.net. (
                                2005011000      ;serial number
                                10800           ;refresh rate in secounds (3 hours)
                                1800            ;retry rate in secounds (30 minutes)
                                1209600         ;expire in seconds (2 weeks)
                                604800  )       ;minimum in secounds (1 week)

                        IN      NS      myhost.xemous.net.
myhost.xemous.net.    IN      A 192.168.0.1
xp.xemous.net.           IN      A       192.168.0.187
gn.xemous.net.           IN      A       192.168.0.121
sw.xemous.net.           IN      A       192.168.0.194

x.xemous.net.             IN      CNAME   192.168.0.187
in the /var/named/xemous.net.rev file :
Code:
$TTL 604800
xemous.net.             IN      SOA     myhost.xemous.net. hostmaster.xemous.net.(
                                2005011001      ;serial
                                10800           ;refresh rate (3 hours)
                                1800            ;retry (30 minutes)
                                1209600         ;expire (2 weeks)
                                604800 )        ;minimum (1 week)

                IN      NS      myhost.xemous.net.

1.0.168.192.in-addr.arpa.              IN      PTR     myhost.xemous.net.
187.0.168.192.in-addr.arpa.              IN      PTR     xp.xemous.net.
121.0.168.192.in-addr.arpa.              IN      PTR     gn.xemous.net.
194.0.168.192.in-addr.arpa.              IN      PTR     sw.xemous.net.

Last edited by Cedrik; 01-09-2005 at 02:07 PM.
 
Old 01-09-2005, 07:19 PM   #3
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
Re: DNS issues with BIND

Quote:
Originally posted by xemous
I'v got some problems with my DNS server.

Ok first question, how do I change my host name.

This is what i get when I run host localhost
Code:
[root@localhost root]# host localhost
localhost.vic.bigpond.net.au has address 127.0.0.1
I am thinking that localhost.vic.bigpond.net.au is my hostname?

This is whats in the /etc/resolv.conf
Code:
[root@localhost root]# more /etc/resolv.conf
nameserver 61.9.128.14
nameserver 61.9.192.15
search vic.bigpond.net.au
You are configuring your resolver libs to point to name servers that (I'm quessing) are your ISP name servers. The dig/host commands use the resolver lib configuration unless overridden. If you are wanting to use your name server, then either change the nameserver record in resovl.conf to point to the IP address of your name server or use:
dig @192.168.1.2 xemous.net ns


If i change the vic.bigpond.net.au to anything else it fails;
Such as xemous.net (my test domain) i get this:
Code:
[root@localhost root]# host localhost
Host localhost not found: 3(NXDOMAIN)
Using the host command, that would be the correct response based on your zone files. (see below)

The hosts file is this:
Code:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain    localhost
Ok now this is the DNS stuff which isnt working, probably due to the above problems

The named.conf
Code:
// generated by named-bootconf.pl

options {
        directory "/var/named";
        /*
         * If there is a firewall between you and nameservers you want
         * to talk to, you might need to uncomment the query-source
         * directive below.  Previous versions of BIND always asked
         * questions using port 53, but BIND 8.1 uses an unprivileged
         * port by default.
         */
        // query-source address * port 53;
};

//
// a caching only nameserver config
//
controls {
        inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
        type hint;
        file "named.ca";
};

zone "localhost" IN {
        type master;
        file "localhost.zone";
        allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
        type master;
        file "named.local";
        allow-update { none; };
};

zone "xemous.net" {
        type master;
        file "xemous.net.db";
};

zone "1.168.192.in-addr.arpa" {
        type master;
        file "xemous.net.rev";
};

include "/etc/rndc.key";
And the /var/named/xemous.net.db file:
Code:
 
$TTL 604800
xemous.net.                     IN      SOA     localhost.xemous.net.   hostmaster.xemous.net. (
                                2005011000      ;serial number
                                10800           ;refresh rate in secounds (3 hours)
                                1800            ;retry rate in secounds (30 minutes)
                                1209600         ;expire in seconds (2 weeks)
                                604800  )       ;minimum in secounds (1 week)

                        IN      NS      61.9.128.14
                        IN      NS      61.9.192.15

xp                      IN      A       192.168.0.187
gn                      IN      A       192.168.0.121
sw                      IN      A       192.168.0.194

x                       IN      CNAME   192.168.0.187
1) Your NS records are poining to a public IP address's, but based on the A records it looks like you are trying to configure a private name server using rfc1918 address space. So what is the IP addres of your name server? If its something like 192.168.0.187, then your name server records should point to that address.

2) Address records point to IP address's (they are OK), CNAME's point to the name used in address records, not an IP address as you have shown.


And the /var/named/xemous.net.rev file
Code:
$TTL 604800
xemous.net.             IN      SOA     1.168.192.in-addr.arpa. hostmaster.xemous.net. (
                                2005011001      ;serial
                                10800           ;refresh rate (3 hours)
                                1800            ;retry (30 minutes)
                                1209600         ;expire (2 weeks)
                                604800 )        ;minimum (1 week)

                IN      NS      61.9.128.14
                IN      NS      61.9.192.15

187             IN      PTR     xp.xemous.net.
121             IN      PTR     sq.xemous.net.
194             IN      PTR     gn.xemous.net.
The start of authority (SOA) record format does not change in a forward or reverse zone definition. Plus you are referencing the domain name (xemous.net) instead of the reverse zone as its called in named.conf. Example:
Code:
@             IN      SOA     ns1.xemous.net. hostmaster.xemous.net. (
                                2005011001      ;serial
                                10800           ;refresh rate (3 hours)
                                1800            ;retry (30 minutes)
                                1209600         ;expire (2 weeks)
                                604800 )        ;minimum (1 week)
Note: The @ sign is replaced with the zone name from named.conf when it is parsed by named at startup.
 
Old 01-09-2005, 11:43 PM   #4
xemous
Member
 
Registered: Jun 2004
Posts: 80

Original Poster
Rep: Reputation: 15
I'm stunned, it actually works. All i did was follow scowles instructions in the resolv.conf file, and added in
nameserver 127.0.0.1, and used cedriks examples to further fix my conf files.

And it works!

Thanks to all who replied.
 
Old 01-10-2005, 07:09 AM   #5
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
Quote:
Originally posted by xemous
I'm stunned, it actually works. All i did was follow scowles instructions in the resolv.conf file, and added in
nameserver 127.0.0.1, and used cedriks examples to further fix my conf files.

And it works!

Thanks to all who replied.
I'm stunned too. Especially if you did not make the SOA change in your reverse lookup zone.

Does the following command work?
dig -x 192.168.0.187
 
Old 01-11-2005, 10:29 PM   #6
xemous
Member
 
Registered: Jun 2004
Posts: 80

Original Poster
Rep: Reputation: 15
This is what came up when I used the command.
Code:
[root@localhost root]# dig -x 192.168.0.187

; <<>> DiG 9.2.0 <<>> -x 192.168.0.187
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 61233
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;187.0.168.192.in-addr.arpa.    IN      PTR

;; ANSWER SECTION:
187.0.168.192.in-addr.arpa. 604800 IN   PTR     xp.xemous.net.

;; AUTHORITY SECTION:
0.168.192.in-addr.arpa. 604800  IN      NS      vmbox.xemous.net.

;; Query time: 6 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Wed Jan 12 15:25:21 2005
;; MSG SIZE  rcvd: 91
I'm unsure about were the hostname is stored, but a grabbed a few books from a mate. DNS and BIND, and a few UNIX manuals from O'reilly which im reading now to fix up those details.
 
Old 01-12-2005, 11:18 AM   #7
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
It's all fine, congatulation your DNS config works
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dns (bind) njdownes Linux - Networking 3 02-28-2005 09:15 AM
DNS and bind amjad General 0 02-17-2005 09:19 AM
dns/bind stanev Debian 1 12-14-2004 08:05 AM
lame dns servers etc and general dns issues suse_linux9.1 Linux - Networking 3 06-01-2004 01:50 PM
DNS and BIND dilberim82 Linux - General 10 07-13-2001 10:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration