Setting up BIND and MyDNS

please note : this is writen for OpenBSD / Fedora/ Centos
the steps are label for what OS just make sure you look for your OS than do :)

if the mysql servers goes down than the DNS just stops working : due to bind does not have any record its just an forward thats all its job is


This could be used for your own network
you have BIND running for your own DNS server : to handle the looksups
and use MyDNS to run / admin your privte inhouse sites

so lets get down to work
We NEED / Use two IP address
One is for the MyDNS to bind to (listen on)
The the other one is for BIND
Which is on the publice interface

-->> If you using an DHCP server : much sure you pick an IP address out of the DHCP pool <--


i setup an IP of : change that to what IP you want
and my box has the IP of : replace that with your local IP or localhost :)


Step 1 : Interface setup


vi /etc/hostname.INTERFACE

copy and paste this into the putty / termianl window
add this to the bottom of te file

inet alias

save file and reboot
than ping the on another box to check to see if its working :)

Fedora / Centos

vi /etc/sysconfig/network-scripts/ifcfg-eth0:0

than copy and paste


/etc/init.d/network restart

than ping the on another box to check to see if its working :)

Step 2 : install MyDNS

Now we have to setup Mydns database and  back/front end

Time for the Fun stuff

im not going to rewrite an 2 pages of howto that falko did for the fedora / centos
and what i for OpenBSD,
so simple just follow them and come back here to
once finished go on to Step 3

PLEASE installed Bind / Named as well if its not installed
if you using OpenBSD than you dont need to worry about this Named/Bind comes as an part of the OS

setup howto for         Fedora 8            Centos 5.1            OpenBSD 4.2

once the install of myns is done
add some test domains to try out  for the dig later on to see if BIND is forwarding them to our MyDNS server

Step 3 : config our servers

Time For the fun part
we going to set mydns to listen on our new IP and than setup some forward record up in bind/named

OpenBSD / Fedora / Centos Users do this step

vi /etc/mydns.conf

and change the

listen = *                   TO         listen =
log = LOG_DAEMON             TO         log = /var/log/mydns

Bind / Named


vi /var/named/etc/named.conf

Fedora / Centos

vi /etc/named.conf

add to the bottom of the file

change : = mydomain.tld
and the to your MyDNS IP
if you got more than one
DNS zone to add
just copy and paste :)

zone "" {
        type forward;
        forwarders {
       port 53;

save file



Fedora /CentoS

/etc/indit.d/named start

Step 4 : testing DNS

Time to test to see if your DNS forward in bind is working or not

dig @

the output should look something like this
change the to your site in MyDNS to see if its works or not

# dig @

; <<>> DiG 9.3.4 <<>> @localhost
; (2 servers found)
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62215
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

; IN A


;; Query time: 45 msec
;; SERVER: ::1#53(::1)
;; WHEN: Mon Mar 24 12:14:33 2008
;; MSG SIZE rcvd: 49



Step 5 : starting on boot

if you want them to start on boot
this is what you add rc.local

Fedora/ Centos / OpenBSD users tpye in
than copy and paste the one you need for your OS 

vi /etc/rc.local

 OpenBSD users

echo -n 'mysql'
/usr/local/bin/mysqld_safe &
sleep 5

echo -n 'MyDNS'
/usr/local/sbin/mydns -b

echo -n 'BIND : front end DNS server'

Fedora / Centos Users

echo -n 'mysql'
/etc/init.d/mysqld start

echo -n 'myDNS'
/etc/init.d/mydns start

echo -n 'BIND : front end DNS'
/etc/init.d/named start

Click the Home Tab to go back to the Homepage

THis Page is powered by Dolphin Tabs Menu- by JavaScript Kit


if you want to see any howto or want to email me an thanks
or ask to use work on any website or anything else
email me here>> Email Me <<

remove the -SPAM-FREE-Zone part out of the address