pelgrim / bind_docker

A BIND dns server container, built on top of Phusion's Baseimage.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ISC BIND Docker Container

A BIND dns server container, built on top of Phusion's Baseimage.

How it works

  1. A data dir, where you will store both named.conf.local and custom zones' configuration files, will be mounted by docker for the container on /data, before it starts running the BIND daemon.

  2. When it starts, after the direcory is mounted, the image will copy the named.conf.local file to the daemons' configuration directory, also before it starts running the BIND daemon.

  3. Finally, the BIND daemon is started in the foreground.

How to use it

  1. Create a data dir, where you will store your custom configurations.

  2. Write a custom named.conf.local inside this data dir. An example:

     // data/named.conf.local
    
     zone "lan.example.com" {
       type master;
       file "/data/db.lan.example.com";
     };
    
     zone "200.168.192.in-addr.arpa" {
       type master;
       notify no;
       file "/data/db.192.168.200";
     };
    
  3. Write the zone files inside your data dir, such as:

     ; data/db.lan.example.com
     ; Zone file for lan.example.com
     ;
     $TTL    86400
     @       IN      SOA     lan.example.com. root.lan.example.com. (
                                   1         ; Serial
                              604800         ; Refresh
                               86400         ; Retry
                             2419200         ; Expire
                               86400 )       ; Negative Cache TTL
     ;
     @       IN      NS      ns1.lan.example.com.
     ns1     IN      A       192.168.200.1
    

and

    ; data/db.192.168.200
    ; Zone file for 192.168.200
    ;
    $TTL    86400
    @       IN      SOA     lan.example.com. root.lan.example.com. (
                                  1         ; Serial
                             604800         ; Refresh
                              86400         ; Retry
                            2419200         ; Expire
                              86400 )       ; Negative Cache TTL
    ;
    @               IN      NS      ns1.lan.example.com.
    1               IN      PTR     ns1.lan.example.com.
  1. Now, run your container with a command such as:

     docker run -d --name dns -v data:/data -p 53:53/tcp -p 53:53/udp plgr/bind
    

What else?

Maintained by Lucas Vieira Souza da Silva, July 2016.

Licensed under Apache 2.0 License. Check the LICENSE file.

If you noticed a problem whatsoever, please, let me know.

About

A BIND dns server container, built on top of Phusion's Baseimage.

License:Apache License 2.0


Languages

Language:Shell 100.0%