Intranet: setup DJBDNS to respond for *.local to help development

 

0. Follow instructions to setup a DNS Cache

 

1. Create an alias for eth0:

# nano /etc/network/interfaces

auto eth0:0
iface eth0:0 inet static
       address 10.0.0.251
       netmask 255.255.255.0
       network 10.0.0.0
       broadcast 10.0.0.255
       gateway 10.0.0.254

2 . restart networking

# /etc/init.d/networking restart

 

3. Use tinydns-conf to setup djbdns 

# tinydns-conf dnscache dnslog /etc/tinydns 10.0.0.251

 

# ln -svf /etc/tinydns /etc/service

# cd /etc/service/tinydns/root/

 

 

4. Setup the "local" domain name:

# ./add-ns local 10.0.0.251

#./add-host a.ns.local 10.0.0.251

 

5. Create the data file for tinydns

# cd /etc/service/tinydns/root/

# nano data

 

.local:10.0.0.251:a:259200
=a.ns.local:10.0.0.251:86400
+*.local:10.0.0.250:86400

 
In the sample file above:
– 10.0.0.251 is the IP address of the DNS server, so it is the one responsibe for domain name responses
– 10.0.0.250 is the IP address of your future Web server
 
Save and update data/cdb
# make
 
 
 
6. Edit /etc/resolv.conf
search portnumber53.local
nameserver 10.0.0.251

 

 

7. Let dnscache know about your *.local domain names:

# cd /etc/service/dnscache

# echo 10.0.0.251 > root/servers/local

# chmod 644 root/servers/local

 

8. Restart dnscache

# svc -t .

 

 

 

Tagged , , , . Bookmark the permalink.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • IGlr