View Full Version : DNS issue
stephenn 08-23-2002, 09:46 AM Hi DNS Gurus,
To set it up Secondary Name server, is it same way as setting up
Primary server or It jsut copy and paste the zone file.
Thanks
Stephen
stephenn 08-23-2002, 10:22 AM Do People keeps primary and secondary name server in Sameserver with different IP? or do they keep in different
server?
Thanks
Ananthan
dandanfirema 08-23-2002, 11:14 AM It really should be on atleast 2 different servers, we use 3 (2 in one datacenter, 1 in another). If you are setting up a secondary server, your named.conf entry should look like this:
zone "yourdomain.com" {
type slave;
file "/var/named/yourdomain.com.db";
masters { 123.123.123.123; };
};
Replace 123.123.123.123 with the ip address of your master (primary) dns server
dandanfirema 08-23-2002, 11:16 AM Also, you don't need to actually move the zone file, this will be created automatically for you when you restart dns
stephenn 08-23-2002, 11:29 AM so you mean it would aoutamatically create
"/var/named/yourdomain.com.db" file .
I dont need to configure anything. Is it going to copy from
Primary server?
Thanks
Stephen
dandanfirema 08-23-2002, 11:31 AM Yes, it does a transfer of the zone file from the primary server. Just add the lines for the domain on the secondary server, restart dns, and check the log file. named has a bad habit of saying that it started...then failing. If you don't check the log file, you will never know....till something doesnt work
stephenn 08-23-2002, 11:43 AM You mean this file right
"/var/named/yourdomain.com.db" file .
Also can I jsut tye restart dns in prompt
]restart dns
Thanks
ananthan
dandanfirema 08-23-2002, 11:54 AM there are several ways to restart dns...you can type
/etc/init.d/named restart
service named restart
or the way I have taken to doing it lately
ps -ef | grep named
(figure out which process is the main named process)
kill -HUP 1234
replacing 1234 with the number of the main named process
I am sure there are other ways
Just don't forget to
tail -25 /var/log/messages
when you are done to make sure named continued to run
stephenn 08-23-2002, 12:12 PM Other questions,
If my primary server located in anywhere ? would it going
to copy.
This is really intersing? how does it copy, if you dont mind.
thanks for your help all the way.
Thanks
Stephen
dandanfirema 08-23-2002, 12:41 PM It is done by transfering the domain information from the primary. It then creates the file in the location you specify in your conf file. The log file may look something like this following a transfer/update of a domain:
Aug 21 18:12:07 servername named[4461]: zone yourdomain.com/IN: transfered serial 6
Aug 21 18:12:07 servername named[4461]: transfer of 'yourdomain.com/IN' from 123.123.123.123#53: end of transfer
If I recall correctly, server transfers are done via TCP on port 53.
If you are really looking at configuring and understand dns, I would recommend o'reilly's book on the subject. It also has some information on securing these transfers with keys.
archie2 08-23-2002, 12:56 PM That was a good information.
stephenn 08-23-2002, 01:31 PM thanks for all info
Those who keeps priamry and secondary name server on same
machine doens have any advanatage only if primary server ip goes down then it will take a look at secondary.
Also I can have many Name servers on same Server right.
Thanks
Stephen
dandanfirema 08-23-2002, 01:35 PM You can have named listen to many IP addresses.
TQ Mark 08-23-2002, 02:00 PM You must authorize your slave(s) to transfer the zonefiles:
An example of your master (10.1.1.1) is:
zone "testdomain.com" {
type master;
file "db.testdomain.com";
allow-query { any; };
allow-update { none; };
allow-transfer { 10.1.1.1; 127.0.0.1; 10.1.5.5; };
};
And the slave (10.1.5.5) is:
EDIT, oops mistake corrected:
zone "testdomain.com" {
type slave;
file "db.testdomain.com";
allow-query { any; };
allow-update { none; };
allow-transfer { 10.1.1.1; 127.0.0.1; 10.1.5.5; };
masters { 10.1.1.1; };
};
you can set defaults for allow-query and allow-update .. just make sure you know what you are doing, read "DNS and BIND" by O'Reilly!
Mark
tqhosting.comEDIT
stephenn 08-23-2002, 02:06 PM zone "testdomain.com" {
type master; ====> isnt it slave?
file "db.testdomain.com";
allow-query { any; };
allow-update { none; };
allow-transfer { 10.1.1.1; 127.0.0.1; 10.1.5.5; };
masters { 10.1.1.1; };
};
this is what I was thinking how to give permission for this.
thanks
Stephen
stephenn 08-23-2002, 02:09 PM hi dandanfirema,
if we run both of them in same server then zone file also same right?
Thanks for all of your info.
thanks
dandanfirema 08-23-2002, 03:09 PM If you are using 2 ip addresses from the same server as your primary and secondary, then you need to do nothing. It will already be working as long as named is listening to the other IP addresses. If add the additional declaration to the named.conf file that already contains the declaration for the master, named will fail.
|