OK heres the whole shebang with a real example:
Problem:
I own ausinvestor.com. I purchase two extra IPs 70.85.16.70 & 70.85.16.71 from linode for the nameservers. I want to set up BIND (the named daemon) on my linode for this domain.
Answer:
1. We register ausinvestor.com with godaddy. We then have to "register" the nameservers with the root nameservers. Luckily godaddy has an interface for this (with MelbourneIT for example you have to phone them up to do this)
- Select ausinvestor.com in the godaddy control panel
- Go to Nameservers Summary, set up NS1.AUSINVESTOR.COM and NS2.AUSINVESTOR.COM
- Go to Domain Host Summary, set up IP 70.85.16.70 for NS1.AUSINVESTOR.COM and 70.85.16.71 for NS2.AUSINVESOT.COM
Your Godaddy summary should look like this:
Code:
Status: Active (LOCKED) Unlock Domain
Registration Type: Public Add Privacy
Registered Date: 10/14/2005
Expiration Date: 10/14/2006 Renew Now
Auto-Renew: Off Change Settings
Website Hosted Here: No
Auth Info Code: (sent by email) Send Email
...
Nameservers Summary
NS1.AUSINVESTOR.COM
NS2.AUSINVESTOR.COM
Last Updated: 10/15/2005
Click here to see details or to modify.
Forwarding
Email Summary
Domain Host Summary
NS1.AUSINVESTOR.COM
70.85.16.70
NS2.AUSINVESTOR.COM
70.85.16.71
Click here to see details or to modify.
2. At bootup:
Code:
# We pay linode for two extra IPs for out name servers
# Assign then to eth0
ifconfig eth0:1 70.85.16.70 netmask 255.255.255.0 up
ifconfig eth0:2 70.85.16.71 netmask 255.255.255.0 up
#start BIND
named
3. The main BIND control file:
/etc/named.conf:
Code:
// look in /var/named for zone files
options {
directory "/var/named";
};
//my logging
logging {
category "default" { "debug"; };
category "general" { "debug"; };
category "database" { "debug"; };
category "security" { "debug"; };
category "config" { "debug"; };
category "resolver" { "debug"; };
category "xfer-in" { "debug"; };
category "xfer-out" { "debug"; };
category "notify" { "debug"; };
category "client" { "debug"; };
category "unmatched" { "debug"; };
category "network" { "debug"; };
category "update" { "debug"; };
category "queries" { "debug"; };
category "dispatch" { "debug"; };
category "dnssec" { "debug"; };
category "lame-servers" { "debug"; };
channel "debug" {
file "/tmp/nameddbg" versions 2 size 1m;
print-time yes;
print-category yes;
};
};
//
// The full zone file
//
// This resolves to /var/named/ausinvestor.com
zone "ausinvestor.com" {
type master;
file "ausinvestor.com";}
;
4. Ausinvetor.com zone file. Have ausinvestor resolve to my linode IP 64.5.53.79. (Note eth0 now has 64.5.53.79, 70.85.16.70, 70.85.16.71, latter latter two are for DNS only).
We specified before that the zone files would be in /var/named.
/var/named/ausinvestor.com:
Code:
$TTL 28880
@ IN SOA ns1.ausinvestor.com. root.ausinvestor.com. (
2005120801 ; serial, todays date + todays serial #
28880 ; refresh, seconds
120 ; retry, seconds
1209600 ; expire, seconds
28880 ) ; minimum, seconds
NS ns1.ausinvestor.com.
NS ns2.ausinvestor.com.
MX 10 mail.ausinvestor.com. ; Primary Mail Exchanger
TXT "ausinvestor.com"
ausinvestor.com. IN A 64.5.53.79
www.ausinvestor.com. IN A 64.5.53.79
mail.ausinvestor.com. IN A 64.5.53.79
5. Wait a few hours for DNS propagation. Use DNSReport to see if it works:
http://dnsreport.com/tools/dnsreport.ch ... vestor.com
6. In the zone file, there is a BIG difference between ausinvestor.com and ausinvestor.com. The trailing period denotes a root zone.