LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 10-01-2010, 12:26 AM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Rep: Reputation: 45
Problem with creating slave DNS Server.


I have configured successfully my master DNS server (192.168.1.254) on red hat linux enterprise 4 .I have also create my slave DNS server (192.168.1.253) but unfoertunately the slave DNS server is not coping the Zone database files in

/var/named/chroot/var/named

Following is my slave forward and reverse

Code:
zone   “mydomain.com”  IN  {
                        type slave;
                         file “mydomain.com.fwd”;
                         masters   {192.168.1.254;  };
            };
		
	zone   “1.168.192.in-addr.arpa”  IN  {
                        type slave;
                         file “mydomain.com.rev” ;
                         masters   {192.168.1.254;  };
            };
Following is the master

Code:
zone "mydomain.com" IN {
      type master;
      file "mydomain.com.fwd";
      allow-transfer { 192.168.1.253; 192.168.1.254; };
};

zone "1.168.192.in-addr.arpa" IN {
      type master;
      file "mydomain.com.rev";
      allow-transfer { 192.168.1.253; 192.168.1.254; };
};
please help me why not the zone batabase not transfering. I have disable the firewall also and open only port 53,even restart named.conf file but still no success.
thanks

mypass
 
Old 10-01-2010, 12:41 AM   #2
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: RHEL/Ubuntu/Debian/Fedora/Centos/K3OS
Posts: 1,159
Blog Entries: 4

Rep: Reputation: 149Reputation: 149
Ok how did you check whether its working or not?
Also let us know while checking what the error you get?
 
Old 10-01-2010, 02:06 AM   #3
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
here is the output by which I test by Master DNS server.


Code:
[root@ns1 ~]# dig A pc1.mydomain.com    
; <<>> DiG 9.2.4 <<>> A pc1.mydomain.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 61797
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;pc1.mydomain.com.              IN      A

;; ANSWER SECTION:
pc1.mydomain.com.       86400   IN      A       192.168.1.1

;; AUTHORITY SECTION:
mydomain.com.           86400   IN      NS      ns1.mydomain.com.

;; ADDITIONAL SECTION:
ns1.mydomain.com. 86400  IN      A       192.168.1.254

;; Query time: 363 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Jul 23 01:51:28 2010
;; MSG SIZE  rcvd: 91

[root@ns1 ~]#
 
Old 10-01-2010, 02:42 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
Hi,

Quote:
;; AUTHORITY SECTION:
mydomain.com. 86400 IN NS ns1.mydomain.com.
Looks like your secondary dns is not present in the NS records, as it's not listed in the authority section above.
You didn't post the zone files, but you should make sure you have both NS records defined:
Code:
 IN NS ns1.mydomain.com.
 IN NS ns2.mydomain.com.
Regards
 
1 members found this post helpful.
Old 10-01-2010, 03:17 AM   #5
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
Here are the zone files

Forward zone

Code:
[root@ns1 named]#vi@mydomain.com.fwd      
     $TTL	86400
      @			IN SOA	localhost root	(
							42		; serial   (d.    admin)
							3H		;refresh
							15M		;retry
							1W		;expire
							1D		;minimum
			IN   NS		localhost
     localhost		IN   A			127.0.0.1

Reverse Zone

Code:
[root@ns1 named]#vi@mydomain.com.fwd           
     $ORIGIN	mydomain.com.
     $TTL	86400
      @			IN SOA ns1.mydomain.com.	admin@mydomain.com (
						20100722		; serial   (d.    admin)
						3H		;refresh
						15M		;retry
						1W		;expire
						1D		;minimum
       @			IN NS		ns1.mydomain.com.
       @			IN MX	    10	ns1.mydomain.com.
        ns1.mydomain.com.		   IN	A	     192.168.1.254
         www					   IN	CNAME   ns1
        pc1.mydomain.com			   IN     A	      192.168.1.1
 
Old 10-01-2010, 03:45 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
The zone files are not correct, or you've mixed 'em during copy/paste. Anyway you can use the following

Forward:zone
Code:
    
$TTL	86400
@	IN SOA	ns1.mydomain.com. root.localhost	(
	42		; serial   (d.    admin)
	3H		;refresh
	15M		;retry
	1W		;expire
	1D		;minimum

	IN   NS	ns1.mydomain.com. 
	IN   NS	ns2.mydomain.com. 
        IN   MX 10 ns1.mydomain.com.

ns1   IN   A       192.168.1.254
ns2   IN   A       192.168.1.253
www	CNAME    ns1
pc1	IN   A	192.168.1.1

;If you want to define localhost add a trailing dot
localhost.		IN   A			127.0.0.1
Reverse zone
Code:
$TTL	86400
$ORIGIN	1.168.192.in-addr.arpa

@	IN SOA ns1.mydomain.com.	admin.mydomain.com (
	20100722	;serial   (d.    admin)
	3H		;refresh
	15M		;retry
	1W		;expire
	1D		;minimum

         IN   NS	ns1.mydomain.com.
	 IN   NS	ns2.mydomain.com. 
        
1       PTR    pc1.mydomain.com.    
254   PTR    ns1.mydomain.com.
253   PTR    ns1.mydomain.com.
Increase both serial numbers and restart bind.
And check logs if it send any NOTIFY to the slave.
 
1 members found this post helpful.
Old 10-01-2010, 06:38 AM   #7
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
thanks "bathory" I have checked it but still i can't see the zone file in my slave server.
My updated forward file is

Code:
[root@ns1 named]#vi@mydomain.com.fwd           
     $ORIGIN	mydomain.com.
     $TTL	86400
      @			IN SOA ns1.mydomain.com.	admin@mydomain.com (
						20100722		; serial   (d.    admin)
						3H		;refresh
						15M		;retry
						1W		;expire
						1D		;minimum
       @			IN NS		ns1.mydomain.com.
       @			IN MX	    10	ns1.mydomain.com.
        ns1.mydomain.com.	IN A	     192.168.1.254
        ns2.mydomain.com.	IN A	     192.168.1.253
        www			IN CNAME   ns1
        pc1.mydomain.com	IN   A	      192.168.1.1
        localhost.		IN   A	      127.0.0.1
kindly any idea that why the zone files are not coping in slave DNS server.Definately something from my end will be wronge but i am unable catch my mistake.
 
Old 10-01-2010, 06:54 AM   #8
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
Still you didn't add the secondary NS record!! I've already mentioned in both my previous posts that you need to add the slave dns as a NS RR!!!
Quote:
Forward:zone
Code:


$TTL 86400
@ IN SOA ns1.mydomain.com. root.localhost (
42 ; serial (d. admin)
3H ;refresh
15M ;retry
1W ;expire
1D ;minimum

IN NS ns1.mydomain.com.
IN NS ns2.mydomain.com.
IN MX 10 ns1.mydomain.com.

ns1 IN A 192.168.1.254
ns2 IN A 192.168.1.253
www CNAME ns1
pc1 IN A 192.168.1.1

;If you want to define localhost add a trailing dot
localhost. IN A 127.0.0.1
 
1 members found this post helpful.
Old 10-01-2010, 10:47 AM   #9
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
thanks a lot for your kind help. well i am sure that it was the mistake in
IN NS ns2.mydomain.com. which I was missing every time. Well can you en light that

IN NS ns1.mydomain.com.
IN NS ns2.mydomain.com.

we also use @ in beginning of it.
 
Old 10-01-2010, 03:07 PM   #10
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
You can omit @ as it's implied. Same goes for IN.
But if you omit it you need to leave at least a blank space. If you want you can read about @ and blank substitution here

If your problem is solved, you can mark the thread "Solved" using Thread tools on top of the page

Regards
 
Old 10-02-2010, 12:57 AM   #11
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
thanks "bathory" a lot for your all post. Well your each post is so much informative and you identify where i am doing mistake.I shall try it later and will know you that according to your post the zone have been transfered or not.
 
Old 10-02-2010, 03:00 AM   #12
raviteja_s
Member
 
Registered: Jun 2010
Location: India
Distribution: Redhat
Posts: 68

Rep: Reputation: 1
In the slave u follow thes steps>>.

zone “mydomain.com” IN {
type slave;
file “slaves/mydomain.com.fwd”;
masters {192.168.1.254; };
};

zone “1.168.192.in-addr.arpa” IN {
type slave;
file “slaves/mydomain.com.rev” ;
masters {192.168.1.254; };
};

now These two files r create under slaves dirctory.............



IN THE MASTER named.conf file

allow-transfer { 192.168.1.253 }

forwarders { };

Last edited by raviteja_s; 10-02-2010 at 03:06 AM.
 
1 members found this post helpful.
Old 10-03-2010, 11:53 PM   #13
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
I have added my secondary record @ IN NS ns2.mydomain.com. but still the files are not copied to the slave DNS server.raviteja_s
as you mentioned to added that add files in slaves directory .In my slave DNS server I have already added the following on

[root@ns2 ~] # vi /etc/named.conf

Code:
zone   “mydomain.com”  IN  {
                        type slave;
                         file “mydomain.com.fwd”;
                         masters   {192.168.1.254;  };
            };
		
	zone   “1.168.192.in-addr.arpa”  IN  {
                        type slave;
                         file “mydomain.com.rev” ;
                         masters   {192.168.1.254;  };
            };
so i should remove these entries in this file which is in /etc/named.conf and create it under
/var/named/chroot/var/named/slaves

please guide me...thanks
 
Old 10-04-2010, 02:32 AM   #14
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
Hi,

To test your nameservers, change something in the forward zone of master, increase serial and reload bind.
Watch the master logs, if it send notifies and if it gets an IXFR from slave
Watch the slave logs if the zone is updated

Here is what actually happens:
Quote:
master
Oct 4 10:19:04 ns1 named[3148]: zone domain.com/IN/external: loaded serial 2008082006
Oct 4 10:19:04 ns1 named[3148]: zone domain.com/IN/external: sending notifies (serial 2008082006)
Oct 4 10:19:04 ns1 named[3148]: client x.x.x.x#37576: view external: transfer of 'domain.com/IN': AXFR-style IXFR started
Oct 4 10:19:04 ns1 named[3148]: client x.x.x.x#37576: view external: transfer of 'domain.com/IN': AXFR-style IXFR ended

slave
04-Oct-2010 10:19:04.198 xfer-in: info: transfer of 'domain.com/IN' from x.x.x.x#53: connected using 192.168.1.50#37576
04-Oct-2010 10:19:04.291 xfer-in: info: transfer of 'domain.com/IN' from x.x.x.x#53: Transfer completed: 1 messages, 8 records, 224 bytes, 0.091 secs (2461 bytes/sec)
Note:
1. The clocks in both master and slave must be synchronized (IIRC they must not have +5min difference)

2. You can do a manual zone transfer (since you use allow-transfer in master) using
Code:
dig -t AXFR mydomain.com @192.168.1.254
3. The zone files in slave, will be created automatically if bind has write permissions on the working directory. You can redirect the above command to the slave zone file mydomain.com.fwd and change ownership to bind user.group

Regards
 
1 members found this post helpful.
Old 10-04-2010, 06:30 AM   #15
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
Smile

Thanks "bathory" and "raviteja_s" . My problem have been solved.Good help.
 
  


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
how to configure master dns in windows2003 server and its slave dns in rhel5 suneellinux Linux - Newbie 1 04-11-2008 05:13 PM
setting up DNS slave server sumit dash Linux - Server 1 07-15-2007 12:51 AM
how too cinfigure the dns slave server sumit dash Linux - Server 1 07-14-2007 02:32 PM
RHEL4 DNS slave server problem John Micheal Linux - Networking 3 06-22-2006 03:46 PM
Slave DNS server guntanis Linux - Networking 4 12-10-2003 09:02 AM

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

All times are GMT -5. The time now is 09:41 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