Operating System - Linux
1833330 Members
3180 Online
110051 Solutions
New Discussion

master slave dns on different network IP

 
tuhintt
Occasional Contributor

master slave dns on different network IP

I do master, slave DNS on the same network and its successful. But what happened when one domain name has two different Name Server IP.
exp -
Name server - ns1.tt.com (100.100.100.100)
Name server - ns2.tt.com (200.200.200.200)
Here what I do (not sure what I am really doing) pls let me know if there any mistake.

acl ext { 100.100.100.0/24; 200.200.200.0/24; };
acl int { 127.0.0.1; 192.168.10.0/24; };
options {
directory "/var/named";
allow-query { ext; int; };
allow-transfer { none; };
notify no;
};
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
type hint;
file "named.ca";
};
zone "tt.com" IN {
type master;
file "tt.zone";
allow-query { any; };
allow-transfer { 200.200.200.200; };
};
zone "100.100.100.in-addr.arpa" IN {
type master;
file "tt100.rev";
allow-query { any; };
allow-transfer { 200.200.200.200; };
};
zone "200.200.200.in-addr.arpa" IN {
type master;
file "tt200.rev";
allow-query { any; };
allow-transfer { 200.200.200.200; };
};
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; };
};
include "/etc/rndc.key";





// tt.zone file
$TTL 86400
$ORIGIN tt.com.
@ IN SOA ns1.tt.com. root.tt.com. (
1 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

IN NS ns1.tt.com.
IN NS ns2.tt.com.
IN MX 1 ns1.tt.com.
IN MX 2 ns2.tt.com.
IN A 100.100.100.100

Ns1 IN A 100.100.100.100
Ns2 IN A 200.200.200.200

//on second server
acl ext { 100.100.100.0/24; 200.200.200.0/24; };
acl int { 127.0.0.1; 192.168.10.0/24; };

options {
directory "/var/named";
allow-query { ext; int; };
allow-transfer { none; };
notify no;
};

controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};

zone "." IN {
type hint;
file "named.ca";
};

zone "tt.com" IN {
type slave;
file "tt.zone" ;
masters { 100.100.100.100; };
allow-query { any; };
notify yes;
};

zone "100.100.100.in-addr.arpa" IN {
type slave;
file "tt100.rev";
masters { 100.100.100.100; };
allow-query { any; };
notify yes;
};


zone "200.200.200.in-addr.arpa" IN {
type slave;
file "tt200.rev";
masters { 100.100.100.100; };
allow-query { any; };
notify yes;
};

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; };
};

include "/etc/rndc.key";




3 REPLIES 3
kcpant
Trusted Contributor

Re: master slave dns on different network IP

Hi tuhintt,

Your file is very long, so stating a confident comment is somewhat difficult, but it seems it should work. the only thing I suspect is, you should define the IP of slave server in options section of master server, where you have written 'none'.but it might work because in zone file you 've explicitly defined zone transfer to be allowed to slave.

regards,
PreSales Specialist
tuhintt
Occasional Contributor

Re: master slave dns on different network IP

thank u for ur suggest, one more this, is it legal to add my own domain name (tt.com) as an A record like,

@ IN SOA ns1.tt.com. root.tt.com.
(
1
3H
15M
1W
1D )

IN NS ns1.tt.com.
IN NS ns2.tt.com.
tt.com. IN A 100.100.100.100 //my own dom

ns1.tt.com. IN A 100.100.100.100
ns2.tt.com. IN A 200.200.200.200
Arthur Hecker
New Member

Re: master slave dns on different network IP

tuhintt,

It is legal to include your actual domain name in an A record as you have done. All you are doing is assigning an IP address to a name. Since you have the authority to assign names and addresses for your domain, that authority includes the name of the domain itself.

The result is that if someone tries to ping tt.com they will be pinging the system at 100.100.100.100 just as if they tried to ping ns1.tt.com.