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 <--

 

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

 

Step 1 : Interface setup

OpenBSD

vi /etc/hostname.INTERFACE

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

inet alias  192.168.1.10 255.255.255.0

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


Fedora / Centos

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

than copy and paste

DEVICE=eth0:0
BOOTPROTO=static
BROADCAST=192.168.0.255
IPADDR=192.168.1.10
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes


/etc/init.d/network restart


than ping the 192.168.1.10 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

MyDNS
OpenBSD / Fedora / Centos Users do this step

vi /etc/mydns.conf


and change the

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



Bind / Named

OpenBSD

vi /var/named/etc/named.conf


Fedora / Centos

vi /etc/named.conf



add to the bottom of the file

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

zone "vdb.site.lan" {
        type forward;
        forwarders {
                192.168.1.10 port 53;
                };
        };

save file


OpenBSD

/usr/sbin/named


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 @192.168.1.102 vdb.site.lan

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

# dig @192.168.1.102 10.vdb.site.lan

; <<>> DiG 9.3.4 <<>> @localhost 10.vdb.site.lan
; (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

;; QUESTION SECTION:
;10.vdb.site.lan. IN A

;; ANSWER SECTION:
10.vdb.site.lan. 86400 IN A 192.168.1.10

;; 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'
/usr/sbin/named


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