Solved

Bind DNS

Posted on 2014-10-16
8
177 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

One of the most frustrating experiences a help desk technician will ever encounter is when a customer comes to them with a solution of their own invention and expects the tech to implement it. This often happens when people with a little bit of tech…
Ever wondered why Windows 8 and 10 don't seem to accept your GPO-based software deployment while Windows 7 does? Read on.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

777 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