LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-19-2009, 01:16 AM   #1
kopper27
Member
 
Registered: Nov 2009
Posts: 147

Rep: Reputation: 16
DNS-Bind 9.3 not working


hi guys

I am trying to setup DNS/Bind but it is not working
my linux client cannot ping server by name neither can my DNS server.

Network Information
DNS Server: 192.168.1.128 (Firewall disabled) Netmask:24
Linux Machine IP: 192.168.10 (Static)
They can ping each by IP.

Linux Machine Configuration
resolv.conf
Code:
search training.com
nameserver 192.168.1.128
/etc/syconfig/network
Code:
NETWORKING=yes
HOSTNAME=station1.training.com
Server Configuration
resolv.conf
Code:
search training.com
nameserver 127.0.0.1
/etc/sysconfig/network
Code:
NETWORKING=yes
HOSTNAME=masterdns.training.com
/var/named/chroot/etc/named.conf

Code:
options {
directory "/var/named";
allow-transfer {
localhost;
};
recursion yes;

allow-recursion {
127.0.0.1;
192.168.1.0/24;
};

listen-on {
127.0.0.1;
192.168.1.128;
};
};

zone "training.com" {
type master;
file "data/training.com.db";
};
zone "localhost" {
type master;
file "data/localhost.db";
};
zone "0.0.127.in-addr.arpa" {
type master;
file "data/127.0.0.rev";
};
zone "." in {
type hint;
file "data/named.ca";
};
Data Files-/var/named/chroot/var/named/data

training.com.db

Code:
$TTL 2d ; 172800 seconds
$ORIGIN training.com.
@        IN      SOA    training.com. hostmaster.training.com. (
2008051200 ; serial number (change when you modify DNS)
1d12h      ; refresh =  1 day 12 hours
15M        ; update retry = 15 minutes
3W12h      ; expiry = 3 weeks + 12 hours
2h20M )    ; minimum = 2 hours + 20 minutes
@        IN     NS      ns1.training.com.
@        IN     A       192.168.1.128
ns1      IN     A       192.168.1.128
www      IN     A       192.168.1.128
mail     IN     A       192.168.1.128
127.0.0.rev

Code:
$TTL 2d
$ORIGIN 0.0.127.in-addr.arpa.
@        IN SOA localhost. admin.localhost. (
2008051101 ; serial number (change when you modify DNS)
1d12h      ; refresh =  1 day 12 hours
15M        ; update retry = 15 minutes
3W12h      ; expiry = 3 weeks + 12 hours
2h20M )    ; minimum = 2 hours + 20 minutes
@        IN NS   localhost.
1        IN PTR  localhost.
localhost.db

Code:
$TTL 2d
$ORIGIN localhost.
@      IN  SOA  localhost. hostmaster.localhost. (
2008051101 ; serial number (change when you modify DNS)
1d12h      ; refresh =  1 day 12 hours
15M        ; update retry = 15 minutes
3W12h      ; expiry = 3 weeks + 12 hours
2h20M )    ; minimum = 2 hours + 20 minutes
@      IN  NS localhost.
@      IN  A  127.0.0.1

Logs - /var/log/messages

This log is after I did a restart to check the whole named process

Code:
ov 19 00:47:52 masterdns named[5803]: shutting down: flushing changes
Nov 19 00:47:52 masterdns named[5803]: stopping command channel on 127.0.0.1#953
Nov 19 00:47:52 masterdns named[5803]: stopping command channel on ::1#953
Nov 19 00:47:52 masterdns named[5803]: no longer listening on 127.0.0.1#53
Nov 19 00:47:52 masterdns named[5803]: no longer listening on 192.168.1.128#53
Nov 19 00:47:52 masterdns named[5803]: exiting
Nov 19 00:47:54 masterdns named[6447]: starting BIND 9.3.4-P1 -u named -t /var/named/chroot
Nov 19 00:47:54 masterdns named[6447]: found 1 CPU, using 1 worker thread
Nov 19 00:47:54 masterdns named[6447]: loading configuration from '/etc/named.conf'
Nov 19 00:47:54 masterdns named[6447]: listening on IPv4 interface lo, 127.0.0.1#53
Nov 19 00:47:54 masterdns named[6447]: listening on IPv4 interface eth0, 192.168.1.128#53
Nov 19 00:47:54 masterdns named[6447]: command channel listening on 127.0.0.1#953
Nov 19 00:47:54 masterdns named[6447]: command channel listening on ::1#953
Nov 19 00:47:54 masterdns named[6447]: zone 0.0.127.in-addr.arpa/IN: loaded serial 2008051101
Nov 19 00:47:54 masterdns named[6447]: zone training.com/IN: loaded serial 2008051200
Nov 19 00:47:54 masterdns named[6447]: zone localhost/IN: loaded serial 2008051101
Nov 19 00:47:54 masterdns named[6447]: running
Nov 19 00:47:54 masterdns named[6447]: zone training.com/IN: sending notifies (serial 2008051200)
Nov 19 00:47:54 masterdns named[6447]: client 192.168.1.128#54975: received notify for zone 'training.com'
Test.
Code:
[root@station1 ~]# nslookup training.com
Server:         192.168.1.128
Address:        192.168.1.128#53

Name:   training.com
Address: 192.168.1.128

[root@station1 ~]# nslookup masterdns.training.com
Server:         192.168.1.128
Address:        192.168.1.128#53

** server can't find masterdns.training.com: NXDOMAIN
What could be causing this?
 
Old 11-19-2009, 05:09 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
How is it supposed to work without adding an entry in your domain's zone file for masterdns?
Add something like:
Code:
masterdns IN A 192.168.1.128
in /var/named/chroot/var/named/data/training.com.db, increase serial, reload bind and you'll be ok.

Cheers
 
Old 11-19-2009, 08:44 AM   #3
kopper27
Member
 
Registered: Nov 2009
Posts: 147

Original Poster
Rep: Reputation: 16
OK I added
Code:
@        IN     NS      ns1.training.com.
@        IN     A       192.168.1.128
masterdns IN    A       192.168.1.128
also incremented

Code:
2008051200 ; serial number (change when you modify DNS)
to
2008051201
ok got your point now my clients can ping masterdns.training.com and server can resolve itselft

but I think I see on log messages (the same I added before) I only see this
Code:
Nov 19 00:47:54 masterdns named[6447]: client 192.168.1.128#54975: received notify for zone 'training.com'
what about the other clients getting updates?
and also clients cannot resolve among them
and neither can the server
Code:
[root@station2 ~]# ping station1.training.com
ping: unknown host station1.training.com

[root@masterdns data]# ping station1.training.com
ping: unknown host station1.training.com
[root@masterdns data]#
 
Old 11-19-2009, 08:53 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
For any host that you want to be resolvable via dns, you have to add a similar entry in the zone file
 
Old 11-19-2009, 09:02 AM   #5
kopper27
Member
 
Registered: Nov 2009
Posts: 147

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by bathory View Post
For any host that you want to be resolvable via dns, you have to add a similar entry in the zone file

really?

should not be that automatically created or something like that?
what if my DNS server supports 1000 clients?


the only thin I can think of is this comparing with Windows 2003
when there are static IPs yes I have to add them manually to my DNS
but when the clients use DHCP they get in my DNS automatically?

so maybe I have to configure a DHCP? Am I correct or I am missing something else?

regards

Last edited by kopper27; 11-19-2009 at 09:11 AM.
 
Old 11-19-2009, 09:12 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
It depends.
If your clients get IP address and hostname from dhcp, then you have to setup the dhcp server to do dynamic updates to your name server.
You can find lots of howtos on this on google.

Else you have to do it by hand

Regards

Last edited by bathory; 11-19-2009 at 09:17 AM.
 
Old 11-20-2009, 12:18 AM   #7
kopper27
Member
 
Registered: Nov 2009
Posts: 147

Original Poster
Rep: Reputation: 16
Guys this is the final documentation about implementing DNS on CentOS 5.3

Thanks to all that helped me

Installing_BIND_9_CentOS_53(3).pdf
Attached Files
File Type: pdf Installing_BIND_9_CentOS_53(3).pdf (30.8 KB, 10 views)

Last edited by kopper27; 11-20-2009 at 12:23 AM.
 
  


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--Forwarding Not Working machismo64 Linux - Server 3 04-15-2009 06:17 PM
bind dns sandeepthug Linux - Newbie 4 12-18-2008 04:53 AM
BIND/DNS setup working(kinda) yah0m Linux - Networking 2 09-25-2008 09:30 AM
How to get Windows Clients to be served DNS from a Linux BIND-DNS Server texmansru47 Linux - Networking 12 07-10-2008 07:06 PM
LXer: DNS: The Bind Leading the Bind LXer Syndicated Linux News 0 06-15-2006 10:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:32 AM.

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