zen shaw
asked on
Bind DNS
Hi,
I have used windows DNS previously, not much familiary with Bind DNS, i would like to a static entry into Bind DNS , to point it to internal IP address of an external machine, i can ssh to that machine at the moment as there is default route in our router, so networking is setup properly.
can somebody please tell me a sample ,how to add an A record and how to add an CNAME in bind ?
thanks
I have used windows DNS previously, not much familiary with Bind DNS, i would like to a static entry into Bind DNS , to point it to internal IP address of an external machine, i can ssh to that machine at the moment as there is default route in our router, so networking is setup properly.
can somebody please tell me a sample ,how to add an A record and how to add an CNAME in bind ?
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i think here, they have host files, which update zone file.
so i don't know really, how to figure out, which host file to update ..so that it can update zone file.
so i don't know really, how to figure out, which host file to update ..so that it can update zone file.
you can retrieve the actual zone file using dig utility/command as follow :)
Btw dig is part of bind-utils package.
dig +nocmd yourfulldomainname.com any +multiline +noall +answer
Btw dig is part of bind-utils package.
dig +nocmd yourfulldomainname.com any +multiline +noall +answer
ASKER
Hi Stampel,
sounds good, can you please explain me this command , what does each argument do ?
looks, it's working.
sounds good, can you please explain me this command , what does each argument do ?
looks, it's working.
+nocmd option is to remove useless info about dig itself like version ...
any cause you want everything for full zone
+multiline option will show records in a verbose multi-line format
+noall to turn off all by default and specify what you want
+answer, to get the answer. I dont know why but you could turn off the ansmer by using the +[no]answer option
You can get more information on the net on howto use dig for example here
https://www.madboa.com/geek/dig/
any cause you want everything for full zone
+multiline option will show records in a verbose multi-line format
+noall to turn off all by default and specify what you want
+answer, to get the answer. I dont know why but you could turn off the ansmer by using the +[no]answer option
You can get more information on the net on howto use dig for example here
https://www.madboa.com/geek/dig/
You can't update a zone file with a host file on a system. That would be very insecure. You need to have admin/root access to the server that is authoritative for the zone and edit that zone file.
Just ssh to the DNS that host the zone.
Edit /etc/named.conf file, you will find there your zone file name like this.
zone "foobar.com" in { type master; notify yes; allow-transfer { common-allow-transfer; }; file "my-foobarzone-file.com"; };
You can then locate the file with find or locate. Usually this place would be /var/named/you-zone-file.t xt /var/named/chroot/var/name d/you-zone -file.txt
Edit the file with your change and increment the serial number (2014101600) , then reload DNS with command "rndc reload" or restart DNS with "service named restart" or "/etc/init.d/named restart"
Of course you need admin/root
Edit /etc/named.conf file, you will find there your zone file name like this.
zone "foobar.com" in { type master; notify yes; allow-transfer { common-allow-transfer; }; file "my-foobarzone-file.com"; };
You can then locate the file with find or locate. Usually this place would be /var/named/you-zone-file.t
Edit the file with your change and increment the serial number (2014101600) , then reload DNS with command "rndc reload" or restart DNS with "service named restart" or "/etc/init.d/named restart"
Of course you need admin/root
You can change TTL if you need faster react.
Dont forget to increment 2014101600 when u change a value.
$TTL 86400
@ IN SOA yourfulldomainname.com. tech.your.full.domain.name
IN NS dns1.registrar.net.
IN NS dns2.registrar.net.
IN MX 1 mx1.mailserver.net.
IN MX 5 mx2.mailserver.net.
IN A 13.18.33.2 #### Your IP Address here
www IN CNAME yourfulldomainname.com.