May 20, 2024

Bind9 Howto

Bind is a DNS server – a sort of phone book for the Internet, so when you type ‘’ it takes you to the IP of their webserver, instead of trying to remember a bunch of different IP’s for the sites you visit.

To make this happen, Bind9 SERVER makes a sort of small phonebook that you can look up numbers with. You only need a server if you want to create your own “phonebook”, otherwise your computer just has a tiny CLIENT that only tells you where to look to find a “phonebook” DNS server.

There are lots of ways to configure Bind9, this is just a down-and-dirty cut/paste that will get you a working DNS server. You can add security stuff as you go, or later after you get it working. You don’t have to install much to make Bind9 work, it’s just the configuration that can be daunting, especially if you’re not quite sure what’s really happening.

This tutorial is done on Debian Wheezy, but it will work on lots of other OS’es with minor modifications. CHANGE THE IP’s to whatever you use, instead of the fictional, use your real public IP. You have to have a public IP to make a DNS server (or a plan if you have your server NAT’ed behind a firewall), so make sure you have one of those and change the to your real one.

Set up Bind9

apt-get install bind9 dnsutils
cd /etc/bind/
mkdir archive
cp named.conf archive
cp named.conf.local archive
cp named.conf.options archive
mkdir zones

Now set yourself up as a nameserver by changing the /etc/resolv.conf, because you want to go looking for DNS on your own server first, then it sends requests elsewhere if you don’t find it on your own server first. You just need one line, delete all the rest.

vi /etc/resolv.conf

Now edit your named.conf and add these lines so the whole thing looks like:

vi named.conf
 // This is the primary configuration file for the BIND DNS server named.
 // Please read /usr/share/doc/bind9/README.Debian.gz for information on the 
 // structure of BIND configuration files in Debian, *BEFORE* you customize 
 // this configuration file.
 // If you are just adding zones, please do that in /etc/bind/named.conf.local
 include "/etc/bind/named.conf.options";
 include "/etc/bind/named.conf.local";
 include "/etc/bind/named.conf.default-zones";
 include "/etc/bind/named.conf.log";

Now create a named.conf.log to set up more useable logging like:

vi named.conf.log
 logging {
        channel update_debug {
                file "/var/log/bind/update_debug.log" versions 3 size 100k;
                severity debug;
                print-severity  yes;
                print-time      yes;
        channel security_info {
                file "/var/log/bind/security_info.log" versions 1 size 100k;
                severity info;
                print-severity  yes;
                print-time      yes;
        channel bind_log {
                file "/var/log/bind/bind.log" versions 3 size 1m;
                severity info;
                print-category  yes;
                print-severity  yes;
                print-time      yes;
        category default { bind_log; };
        category lame-servers { null; };
        category update { update_debug; };
        category update-security { update_debug; };
        category security { security_info; };

Now set up your log files to receive the new logs you just defined:

mkdir /var/log/bind
touch /var/log/bind/bind.log /var/log/bind/security_info.log /var/log/bind/update_debug.log
chown -R bind.bind /var/log/bind

Now create your actual DNS entries for your sites, which are done by creating “zone” files, which we’ll do by editing named.conf.local like:

vi named.conf.local
// Do any local configuration here
// Consider adding the 1918 zones here, if they are not used in your
// organization
include "/etc/bind/zones.rfc1918"; <- uncomment this line
zone "" {
        type master;
        file "/etc/bind/zones/";
        allow-update { key rndc-key; };
zone "" {
        type master;
        file "/etc/bind/zones/";
        allow-update { key rndc-key; };
zone "" {
        type master;
        file "/etc/bind/zone/";
        allow-update { key rndc-key; };

now set up your options like:

vi /etc/bind/named.conf.options
acl internals {;; };
options {
        directory "/etc/bind";
        // Exchange port between DNS servers
        //query-source address * port *;
        // Transmit requests to if
        // this server doesn't know how to resolve them
        forward only;
        forwarders {; };
        auth-nxdomain no;    # conform to RFC1035
        // Listen on local interfaces only(IPV4)
        //listen-on-v6 { none; };
        // listen-on {;; };
        listen-on { any; };
        // Do not transfer the zone information to the secondary DNS
        allow-transfer { none; };
        // Accept requests for internal network only
        // allow-query { internals; };
        allow-query { any; };
        // Allow recursive queries to the local hosts
        // recursion yes;
        allow-recursion { internals; };
        // Do not make public version of BIND
        version none;
// Configure the communication channel for Administrative BIND9 with rndc
// By default, they key is in the rndc.key file and is used by rndc and bind9
// on the localhost
controls {
        inet port 953 allow {; };

now create a zone file for the nameserver itself, which should look like (change to meet your actual domain name):

vi /etc/bind/zones/
$TTL    3600
@       IN      SOA (
                   2007010401           ; Serial
                         3600           ; Refresh [1h]
                          600           ; Retry   [10m]
                        86400           ; Expire  [1d]
                          600 )         ; Negative Cache TTL [1h]
@       IN      NS
@       IN      MX      10
ns1     IN      A
www     IN      A
mail    IN      A
mail    IN      CNAME

Now create a zone file for whatever other domain you want to use this as a nameserver for like:

vi /etc/bind/zones/
$TTL    3600
@       IN      SOA (
                   2007010401           ; Serial
                         3600           ; Refresh [1h]
                          600           ; Retry   [10m]
                        86400           ; Expire  [1d]
                          600 )         ; Negative Cache TTL [1h]
@       IN      NS
@       IN      MX      10
        IN      A
www     IN      A
mail    IN      A
mail    IN      CNAME   mail

Now start bind like:

/etc/init.d/bind9 start
[ ok ] Starting domain name service...: bind9.

If you get an error, start by looking at the last lines of the daemon.log like:

cat /var/log/daemon.log

390 thoughts on “Bind9 Howto

  1. Pingback: 2centres
  2. [url=]diflucan fluconazole[/url] [url=]cheap xenical 120 mg[/url] [url=]albenza 200 mg[/url] [url=]dapoxetine 30mg[/url] [url=]ciprofloxacin 127[/url] [url=]lasix 20mg[/url]

  3. [url=]how to buy cytotec online[/url] [url=]top online pharmacy india[/url] [url=]cheapest price for lyrica[/url] [url=]where can i buy cialis tablets[/url]

  4. [url=]abilify 30 mg price[/url] [url=]propecia discount online[/url] [url=]generic levitra[/url] [url=]seroquel 400 pill[/url]

  5. [url=]toradol pill 10 mg[/url] [url=]gabapentin in india[/url] [url=]buy atarax 10mg[/url] [url=]diflucan 300 mg[/url]

  6. [url=]ciprofloxacin usa[/url] [url=]can i buy nexium over the counter in uk[/url] [url=]reliable canadian online pharmacy[/url] [url=]tetracycline 500 mg tablet[/url] [url=]cephalexin tablets 500mg[/url] [url=]advair prescription price[/url]

  7. [url=]amoxil coupon[/url] [url=]secure medical online pharmacy[/url] [url=]buy zyban without prescription[/url] [url=]dexamethasone india[/url] [url=]buying prozac in mexico[/url] [url=]best canadian online pharmacy[/url] [url=]drug gabapentin 600 mg[/url]

  8. [url=]10mg baclofen tablet[/url] [url=]order pharmacy online egypt[/url] [url=]dexamethasone tablets uk[/url] [url=]over the counter baclofen[/url] [url=]propecia for sale[/url] [url=]canadian pharmacy 1 internet online drugstore[/url]

  9. [url=]generic viagra india[/url] [url=]medicine gabapentin 100mg[/url] [url=]price of tamoxifen 20 mg[/url] [url=]singulair price usa[/url] [url=]mexican pharmacy weight loss[/url] [url=]purchase lasix online[/url] [url=]dexamethasone 10[/url] [url=]175 mg synthroid[/url]

  10. [url=]cafergot[/url] [url=]cheapest pharmacy for prescriptions[/url] [url=]paxil 100mg[/url] [url=]buy sildenafil online canada[/url]

  11. [url=]reliable canadian online pharmacy[/url] [url=]lasix 40[/url] [url=]no prescription fluoxetine[/url] [url=]baclofen 10mg pill[/url] [url=]buy generic cymbalta[/url]

  12. The potential role of buy ivermectin in managing COVID-19 has been a subject of intense debate and scrutiny within the scientific community and among healthcare professionals. While some observational studies and small-scale trials have reported favorable outcomes with ivermectin treatment, others have raised concerns about methodological limitations and conflicting results. Regulatory agencies and professional medical organizations have emphasized the need for well-designed randomized controlled trials to evaluate the efficacy and safety of stromectol in COVID-19 patients.

  13. As researchers continue to investigate the therapeutic potential of ivermectin horse wormer, it is essential to consider the broader implications of its use in public health interventions. Beyond its direct effects on parasites and viruses, stromectol may exert indirect effects on host immune responses, microbiota, and ecological systems. Understanding these complex interactions is critical for optimizing treatment strategies, minimizing unintended consequences, and promoting the responsible use of the drug.

  14. mexican pharmaceuticals online [url=]mexican pharmacy[/url] purple pharmacy mexico price list

  15. nolvadex pills [url=]low dose tamoxifen[/url] does tamoxifen cause bone loss

  16. order cytotec online [url=]Misoprostol 200 mg buy online[/url] buy cytotec online

  17. buy ciprofloxacin [url=]ciprofloxacin 500mg buy online[/url] buy cipro online

  18. purchase cytotec [url=]cytotec online[/url] Cytotec 200mcg price

  19. 25 mg lisinopril [url=]zestril lisinopril[/url] lisinopril 40 mg prices

  20. lisinopril 25 mg [url=]lisinopril 4 mg[/url] lisinopril 40 mg pill

  21. cipro online no prescription in the usa [url=]cipro pharmacy[/url] ciprofloxacin 500mg buy online

  22. buying cheap propecia without dr prescription [url=]get cheap propecia tablets[/url] cost of cheap propecia prices

  23. lisinopril 20mg 37.5mg [url=]lisinopril 20 mg tablet price[/url] lisinopril pills for sale

  24. propecia otc [url=]get generic propecia online[/url] rx propecia

  25. buy cipro online canada [url=]cipro 500mg best prices[/url] purchase cipro

  26. tamoxifen bone pain [url=]does tamoxifen cause weight loss[/url] tamoxifen for men

  27. buy cytotec pills online cheap [url=]cytotec abortion pill[/url] buy cytotec online fast delivery

  28. Buy Cialis online [url=]buy cialis online[/url] Buy Tadalafil 20mg

  29. Viagra online price [url=]Buy generic 100mg Viagra online[/url] п»їBuy generic 100mg Viagra online

  30. Cialis over the counter [url=]buy cialis pill[/url] Generic Tadalafil 20mg price

  31. indian pharmacies safe [url=]mail order pharmacy india[/url] indian pharmacies safe

  32. canadian pharmacy coupon [url=]canadian pharmacy coupon[/url] canadian pharmacy without prescription

  33. best no prescription online pharmacies [url=]best online pharmacies without prescription[/url] best no prescription online pharmacies

  34. lisinopril prescription cost [url=]average cost of lisinopril[/url] compare zestril prices

  35. generic propecia without dr prescription [url=]cost generic propecia prices[/url] cost of cheap propecia

  36. buy lisinopril 10 mg online [url=]can i buy lisinopril over the counter in mexico[/url] lisinopril 10 12.5 mg tablets

  37. can you buy lisinopril online [url=]prinivil drug cost[/url] lisinopril mexico

  38. indian pharmacy [url=]п»їlegitimate online pharmacies india[/url] indian pharmacy online

  39. canada drug pharmacy [url=][/url] canadapharmacyonline com

  40. pharmacies in mexico that ship to usa [url=]reputable mexican pharmacies online[/url] medication from mexico pharmacy

  41. order prescription drugs online without doctor
    reputable mexican pharmacies online [url=]п»їbest mexican online pharmacies[/url] mexican pharmaceuticals online

  42. buying prescription drugs in mexico online
    buying prescription drugs in mexico online [url=]п»їbest mexican online pharmacies[/url] buying from online mexican pharmacy

  43. indian pharmacy paypal [url=]pharmacy website india[/url] buy medicines online in india

  44. pharmacie en ligne france pas cher [url=]vente de mГ©dicament en ligne[/url] pharmacie en ligne sans ordonnance

  45. farmaci senza ricetta elenco [url=]comprare farmaci online all’estero[/url] farmacie online sicure

  46. Farmacie on line spedizione gratuita [url=]Farmacia online miglior prezzo[/url] farmaci senza ricetta elenco

  47. pharmacie en ligne france pas cher [url=]pharmacies en ligne certifiГ©es[/url] pharmacies en ligne certifiГ©es

Leave a Reply

Your email address will not be published. Required fields are marked *