Solved

Bind DNS

Posted on 2014-10-16
8
179 Views
Last Modified: 2014-11-11
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
0
Comment
Question by:zen shaw
  • 4
  • 2
  • 2
8 Comments
 
LVL 23

Accepted Solution

by:
savone earned 500 total points
ID: 40383996
Edit the zone file and add the record. Simple.

hostname.domain.com.         IN      A       192.168.1.1

Same goes for a CNAME record:

alias.domain.com.     IN    CNAME    hostname.domain.com.


Depending on how you installed BIND the zone file can be located in different places.  They are placed in /var/named/ by default, but if you installed bind-chroot, they will be in /var/named/chroot/var/named/.

Good luck.
0
 
LVL 7

Expert Comment

by:Stampel
ID: 40384077
Here is a full linux zone like the one i use.
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.com. (2014101600 86400 3600 3600000 86400)
                         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.
0
 

Author Comment

by:zen shaw
ID: 40385690
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.
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 7

Expert Comment

by:Stampel
ID: 40386904
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
0
 

Author Comment

by:zen shaw
ID: 40401742
Hi Stampel,

sounds good, can you please explain me this command , what does each argument do ?

looks, it's working.
0
 
LVL 7

Expert Comment

by:Stampel
ID: 40401943
+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/
0
 
LVL 23

Expert Comment

by:savone
ID: 40401957
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.
0
 
LVL 7

Expert Comment

by:Stampel
ID: 40401974
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.txt /var/named/chroot/var/named/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
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Both MMF (multi-mode fiber) and SMF (single-mode fiber) are types of optical fiber that can aid in communication applications. These thin strands of silica or glass will allow communication to occur between devices. The transmission of light between…
There's a better way to communicate time sensitive or critical info.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question