bind9 configuration for sharing a zone with ICANN TLD
Posted: Sun May 15, 2011 5:22 pm
I've got a domain name that is currently registered with an ICANN-cabal approved registrar, that I am acting as the primary and secondary nameserver for. I registered the same name in the namecoin universe and I configured the .bit nameservers to point to my already existing nameservers so I could just serve up the same zone information for the .bit domain as I am with the original ICANN domain.
However, this didn't work out of the box, because my nameservers did not know about the .bit zone and needed to be configured to recognize and respond to it. This is how I did this.
First you need to update your namecoin name to map the nameservers to your nameservers. Lets say my original domain name was "foo.net" and I registered "foo.bit"
Then you must configure your bind's named.conf (or named.conf.local if you are using Debian or a Debian derived distro) to recognize the domain:
You should point the file directive to the zone file that "yourname.net" also points to.
Then you need to make sure that "db.yourname" is using RFC 1035 global SOA directive synthesis. In otherwords, if your SOA record says:
then you want to change it to:
(dont forget to bump the serial number, and restart bind!)
The @ will be substituted with an $ORIGIN synthesis based on the value of the zone name in the named.conf file.
Now foo.net subdomains and records will be resolved as they always were, and foo.bit will do the exact same thing. No need to manage two different files with the exact same content!
However, this didn't work out of the box, because my nameservers did not know about the .bit zone and needed to be configured to recognize and respond to it. This is how I did this.
First you need to update your namecoin name to map the nameservers to your nameservers. Lets say my original domain name was "foo.net" and I registered "foo.bit"
Code: Select all
../namecoind name_update d/foo '{"map":{"":{"ns":["YOUR.NAME.SERVER1","YOUR.NAMESERVER2"]}}}'
Code: Select all
zone "foo.bit" in {
type master;
file "/etc/bind/primary/db.foo";
};
Then you need to make sure that "db.yourname" is using RFC 1035 global SOA directive synthesis. In otherwords, if your SOA record says:
Code: Select all
"foo.net IN SOA ...."
Code: Select all
"@ IN SOA ..."
The @ will be substituted with an $ORIGIN synthesis based on the value of the zone name in the named.conf file.
Now foo.net subdomains and records will be resolved as they always were, and foo.bit will do the exact same thing. No need to manage two different files with the exact same content!