In general people test locally if services run correctly on their new IP-addresses by overriding the current DNS records with entries in their hosts file
That doesn't allow you to set up CNAME records of course, you will have to map all records you want to test to the IP-addresses the CNAME records would eventually resolve to, before you can enter them in a hosts file.
Don't forget to remove those entries after you're done testing.
In general I don't think people run test name servers to test DNS changes and usually simply make them in their authoritative DNS server(s) at the time they are needed, but the procedure for that would be:
- Install the same DNS server software you would be running in production on a test server (or your workstation).
- Configure it and copy the master zone file/data from production to your test name server.
- Make DNS changes.
- Test if they are effective with a DNS query, i.e.
dig changed.example.com. @IP-address-of-test-nameserver
.
- Change the network settings for your OS to use the
IP-address-of-test-nameserver
as the preferred/only name server.
- Test you application(s).
- When successful:
Make the same change(s) in production or copy the zone file to production.
Homebrew provides the Bind DNS server https://formulae.brew.sh/formula/bind , Unbound https://formulae.brew.sh/formula/unbound and others for an easy install on your Mac.