1

I would like to achieve the following:

  1. Register own domain name (done) with GoDaddy.com e.g (mynsdom.com) which I will setup two hosts using VPS from Linode (done). Bind9 is also installed on both hosts, ns1.mynsdom.com and ns2.mynydom.com, in a master/slave configuration.

  2. Next, register 2ND domain name (e.g mydom2.com) with GoDaddy.com and set my own nameserver (ns1.nynsdom.com and ns2.mynsdom.com) in a master/slave configuration.

  3. Next, register 3RD domain name (e.g mydom3.com) with GoDaddy.com and set my own nameserver (ns1.mynsdom.com and ns2.mynsdom.com)

Basically, I would have my own publicly available nameserver/s which I can host multiples zones for mydom2.com and mydom3.com and any other domain names I may be registering.

I understand this is a lot of advice to ask for and I would really appreciate it if you could point me to some tutorials if there aren't any that specific.

My questions:

  1. Do I need to do something with my ISP or Domain name registrar in order to have my MYDOM1.COM's NS1.MYDOM1.COM and NS2.MYDOM1.COM recognized as legitimate nameservers?

  2. If NS1.MYDOM1.COM and NS2.MYDOM2.COM aren't able to resolve DNS requests from HOSTNAME.MYDOM2.COM AND HOSTNAME.MYDOM3.COM, then the requests could be forwarded to Google's public DNS where the results would then be cached in NS1.MYDOM1.COM and NS2.MYDOM1.COM. Is this possible?

  3. If NS1.MYDOM1.COM is down for any reason, how may I make NS2.MYDOM1.COM take its place seemlessly?

  4. I would like to access my home server/PC which runs on a dynamic IP address so I also would like to be able to host a zone on my Bind server that allows the NAT'ed server/PC at home to update its public IP address.

  5. How may Master nameservers and how many Slave nameservers should I be running?

  6. Would a 512Mb VPS with just 20Gb of SSD space suffice for hosting 100 domain names/zones (assuming these are the same thing)

I would really like to learn how to setup Bind properly on my Ubuntu VPS and of course save money since I will be registering more domain names.

A.B.
  • 90,397

1 Answers1

2

It's an old question but answering for people who coming to this post via search engine.

To point your domain to VPS you need to configure your VPS to server names-server DNS records, shared hosing comes with name-server but for unmanaged vps you have to setup your own. To serve DNS records we need to install DNS server package like BIND9

Install BIND9, ignore if you have already

apt-get install bind9

Configure and Create Zone File for domains to add records open file name.conf.local and insert zone file name for domain

cd /etc/bind/
vi name.conf.local
zone "mynsdom.com" {
        type master;
        allow-transfer {none;};
        file "/etc/bind/pri.mynsdom.com";
};
zone "zyx.com" {
        type master;
        allow-transfer {none;};
        file "/etc/bind/pri.mydom2.com";
};

save and close file.

Create Zone File for domain

touch pri.mynsdom.com
touch pri.mydom2.com

To create name server ns1.mynsdom.com and ns2.mynsdom.com. added NS and A records. replace 000.000.000.000 with server IP

 vi pre.mynsdom.com
$TTL        3600
@       IN      SOA     host.mynsdom.com. info.mynsdom.com. (
                        2015062803       ; serial, todays date + todays serial #
                        7200              ; refresh, seconds
                        540              ; retry, seconds
                        604800              ; expire, seconds
                        86400 )            ; minimum, seconds
;

mynsdom.com. 3600 A        000.000.000.000
mail 3600 A        000.000.000.000
sv4 86400 A        000.000.000.000
sv4 86400 A        000.000.000.000
www 3600 A        000.000.000.000
mynsdom.com. 3600      MX    10   mail.mynsdom.com.
mynsdom.com. 3600      NS        ns1.mynsdom.com.
mynsdom.com. 3600      NS        ns2.mynsdom.com.

Now add ns1.mynsdom.com and ns2.mynsdom.com as child nameserver in domain register panel and also add in nameserver address in domain register.

To add another domain to same vps

vi pri.mydom2.com
$TTL        3601
@       IN      SOA     host.mynsdom.com. info.mynsdom.com. (
                        2015062813       ; serial, todays date + todays serial #
                        7200              ; refresh, seconds
                        540              ; retry, seconds
                        604800              ; expire, seconds
                        86400 )            ; minimum, seconds
;

mail 3600 A        000.000.000.000
mydom2.com. 3600 A        000.000.000.000
www 3600 A        000.000.000.000
mydom2.com. 3600      NS        ns1.mynsdom.com.
mydom2.com. 3600      NS        ns1.mynsdom.com.
service bind9 restart

You can also add your MX records for email in the zone file of any domain