1

I'm new to the DNS world. I followed this tutorial to config an Authoritative-Only DNS Server. However, the tutorial is only about one domain name and I'm confused on how to add the second domain name. There are also questions in the comments of the tutorial asking about the same question, but there is no answer to them and I couldn't find any other tutorial or questions (like this one) on how to config two domains.

To summarize, we have two web servers example1.com and example2.com for which we would like to use one bind server as our customized DNS. According to the tutorial, we create a zone file for example1.com as follows:

    $TTL    604800
@       IN      SOA     ns1.example1.com. admin.example1.com. (
                              5         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL  
; Name servers
example1.com.    IN      NS      ns1.example1.com.
example1.com.    IN      NS      ns2.example1.com.

; A records for name servers
ns1             IN      A       192.0.2.1
ns2             IN      A       192.0.2.2

; Other A records
@               IN      A       192.0.2.3
www             IN      A       192.0.2.3  

and then we create two NS records(ns1.example1.com and ns2.example1.com) and a glue record on our hosting provider's nameserver. Now how can I add example2.com and use the same bind server to resolve it? I created a zone file and added two new ns records like this:

 $TTL    604800
@       IN      SOA     ns1.example2.com. admin.example2.com. (
                              5         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL    
; Name servers
example2.com.    IN      NS      ns1.example2.com.
example2.com.    IN      NS      ns2.example2.com.
; A records for name servers
ns1             IN      A       192.0.2.1
ns2             IN      A       192.0.2.2
; Other A records
@               IN      A       192.0.2.4
www             IN      A       192.0.2.5

and then added NS records and glue records for n1.example2.com and ns2.example2.com on my hosting provider's name server, so we will have two different nameservers ns1.example1.com and ns2.example2.com for these two different domain names but they both point to the same IP (our configured bind server). Is it a good practice to do that? How can we config it to have just one name server for both?

1 Answer 1

0

You need to have at least two name servers for each domain and they must be on separate addresses, preferably on independent networks. Read IANA's Technical requirements for authoritative name servers.

Network diversity

The name servers must be in at least two topologically separate networks. A network is defined as an origin autonomous system in the BGP routing table. The requirement is assessed through inspection of views of the BGP routing table.

Use your other web server as a secondary NS. Configuring the secondary server is explained in the mentioned tutorial under heading Configure the Slave Bind Server. Or check if your registrar or provider has secondary NS as a service.

4
  • but my question is about if we need to set up new name servers ns1.example2.com and ns2.example.com or use ns1.example.com and example2.com?
    – Nina Brown
    Jul 16, 2018 at 22:45
  • It's perfectly fine to have example.org. NS ns1.example.com. if that's what you are asking. This way you don't need glue records for example.org. Jul 17, 2018 at 4:28
  • @NinaBrown: Did this answer help you well enough or are there still open questions regarding your issue?
    – Tommiie
    Aug 20, 2018 at 11:14
  • not really, I found the answer is that it is not a good practice to create new ns1.{domnainname} glue records where all are pointing to the same name server. So I'm using the same NS for all the newly created domains
    – Nina Brown
    Aug 27, 2018 at 22:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .