How to configure a dns server in debian

link|improve this question
3  
If you type that question into Google you'll find more instructional articles that you will ever be able to read. They will also cover the subject in much greater depth than can be adequately covered in a Q&A site, such as this one. – John Gardeniers Feb 18 '10 at 7:02
First, there are actually two very different kind of DNS servers: authoritative (to server the contents of zones) and recursive (to provide name resolution service to the LAN). Which one do you want? – bortzmeyer Feb 23 '10 at 12:17
feedback

migrated from stackoverflow.com Feb 18 '10 at 5:40

This question came from our site for professional and enthusiast programmers.

2 Answers

Install the bind9 and bind9-utils packages. The config and zone files will be in /etc/bind. Don't change named.conf, put your local config in named.conf.local. (Otherwise your changes may be overwritten during an upgrade.)

When you make changes to your config or zones, you can use the 'rndc' program to manipulate the server instead of the /etc/init.d script. It gives you more control.

Use named-checkconf and named-checkzone to verify that your configuration is correct once you have set up your zones. BIND will let you do "illegal" things without complaint, and then some systems won't be able to send you mail or reach your website.

If you don't know how DNS works, get a good book on DNS. (I like O'Reilly's "DNS and BIND".) DNS is not a trivial system and it's easy to make assumptions that are wrong. The 'check' programs are your friend here.

link|improve this answer
feedback

The proper way would obviously be to use something like bind but the easiest way to do it would be to use dnsmasq. It can function both as a DHCP and a DNS server but you can always disable the DHCP features if you don't need them. Just tell it to ignore the eth0 interface in the configuration. Then, it will function as a pure DNS server. It can also be configured as an authoritative DNS server.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown