Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Is it possible to have two A records under one domain in different servers?

ns1.domain.com from server1 points to 192.168.1.1

and

ns2.domain.com from server2 points to 192.168.1.2

Is this scenario possible? If so how Bind9 can be configured for this purpose please?

share|improve this question
3  
Can you please clarify this question? It's really not clear what you're trying to do. –  MDMarra Dec 2 '12 at 22:52
    
+1 Sure, I edited my post. Thanks –  Steve Dec 2 '12 at 22:59
    
Steve, perhaps you should tell us what your end goal is, rather than what what you're trying to attempt. You seem to want a single domain to be served by multiple servers, but you have private IP space in your public DNS records. You also seem to want two nameservers serving different records (which I don't think is what you want at all), and thirdly I think your actual goal it to have multiple servers behind a single public IP address, which is not done with DNS at all... –  Mark Henderson Dec 2 '12 at 23:08
    
Thank you Mark, actually I want two "A records" in different servers under one single domain. e.g. I've configured domain.com with server1 and also created an A record to point an IP address. so can I create an A record in another server under domain.com? –  Steve Dec 2 '12 at 23:13
1  
I've read this a few times and I still have no idea what you are actually asking. Your question seems to be whether you can ask two different servers (server1 and server2) two different questions (resolve ns1.domain.com and resolve ns2.domain.com) and get two different answers (192.168.1.1 and 192.168.1.2). Well, of course. But is this about different questions getting different answers? Is this about figuring out how to get others to ask different servers? Or what? It would probably help a lot if you explained what problem you were trying to solve. –  David Schwartz Dec 2 '12 at 23:17

1 Answer 1

up vote 0 down vote accepted

All I want is to setup a master and slave DNS server under one domain. so If master server was irresponsible slave server would work. For this I need to create ns1 on server1 and ns2 on server2. (different subnets). But parent domain is configured with server1.

Put the exact same zone file on both servers. The zone file should include both NS records and A records for each nameserver as well. Ideally, the slave should just pull the zone file from the master. Like this:

mydomain.com IN SOA ns1.mydomain.com. hostmaster.mydomain.com.
  ( 1 3600 1100 2000000 8400 )
    IN NS ns1.mydomain.com.
    IN NS ns2.mydomain.com.
ns1.mydomain.com. IN A 1.2.3.4
ns2.mydomain.com. IN A 1.2.3.5

Tell your registrar about both nameservers. If the nameservers are inside the domain they server, make sure glue records are added.

share|improve this answer
    
Yes, Thank you. my problem comes here that I can only set nameservers in my registrar. what nameserver should I put there? One from server1 and another from serevr2? –  Steve Dec 3 '12 at 0:17
    
You should put both nameservers there, ns1 and ns2. –  David Schwartz Dec 3 '12 at 1:31
    
Thank you. nameservers are inside the domain. so I should add an IP, should I add IP of both servers? I mean ns1 with IP of server1 and ns2 with IP of server2. Thanks again. –  Steve Dec 3 '12 at 6:37
    
I guess maybe I'm still confused. Are you trying to have two name servers? Two servers of some other kind? Or both? If you just want two name servers, just make sure you have two machines acting as name servers, two NS records, and two A records. –  David Schwartz Dec 3 '12 at 7:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.