-1

What kind of scripts do I need for that?

Thanks in advance for any explanation or link to tutorial

  • 1
    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. – fuero Aug 22 '21 at 18:18
  • @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. – Phoebe1998 Aug 22 '21 at 18:32

1 Answers1

1

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.
fuero
  • 9,413
  • 1
  • 35
  • 40
  • 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? – Phoebe1998 Aug 22 '21 at 18:56
  • 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. – fuero Aug 22 '21 at 18:58