Score:-1

How can I make a linux CentOS server the master DNS server?

dz flag

What kind of scripts do I need for that?

Thanks in advance for any explanation or link to tutorial

cm flag
Hi and welcome to Serverfault. Your question is rather broad, could you narrow it down a little? Give a little more detail about what you want to achieve. E.g. I'd like my server to be the master of 2 name servers hosting example.com, or I'd like this server to serve as my local DNS server, etc.
Phoebe1998 avatar
dz flag
@fuero I'd like that DNS (let's call it example.com) has my CentOS VM as the master and my Windows Server VM as slave/secondary.
Score:1
cm flag

Here's an example that shows how to set up BIND (aka named, CentOS's DNS server) as a master and a slave for a zone.

This can only be a pointer towards the solution, as you have to answer a few questions to not make your life harder than it has to be:

  • Do you want/need DNSSEC?
  • Do you do static zone management or do you want to use DDNS?
  • Do you want to use TSIG keys to transfer zones to slaves?
  • Do you have more than one slave or plan adding others?

The answers will likely significantly change how you would setup BIND (and your slave(s)).

Here's a (basic) list of steps to follow, assuming no DNSSEC, just the CentOS master and the Windows slave, and IP-based ACLs for transfer:

  • Install bind and ensure that it is started and running on startup.
  • Create a valid zone file and enter your desired zone information. (Use named-checkzone
  • Use named-checkconf to verify the master's config before reloading the server.
  • Create an ACL containing your slave's IP address.
  • Add your zone to the master's and the slave's config. Add the slave's IP to the master's stanza to trigger notifies and add the master's ip to the slave's config to make it able to fully refresh the zone when needed.
  • Verify that your servers operate correctly by querying them with suitable DNS clients (e.g. dig or drill).
  • Verify that synchronization is working by making zone changes and reloading the zone with rndc.
  • Announce the servers as NS records in your zone and to your registrar to get the proper glue records.
Phoebe1998 avatar
dz flag
Is it necessary to create forward zone file as well as reverse zone file or does it depend on the situation? Do I have to create both zone files on both the master and the slave server?
cm flag
If you control the reverse zone, you want this server to become master for it and you want to provide reverse records for the forward zone, then yes you need to add the reverse zone as well to both. Also you need to create at least empty files on the slaves.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.