This is a set of Jest tests for making sure that all domain records are present and accounted for.
This script uses Node's DNS lookup functions: https://nodejs.org/api/dns.html
...looks up the records, and matches them to expected output.
This script doesn't do anything technologically exciting. What it does is makes it much easer to get through the interminable "is it propagated yet?" phase.
It also provides regression testing that you can run before messing with DNS records.
In general, you'll use this repository to verify that you have correctly added a domain record to a zone file, and that you haven't broken anything.
- First, run tests to verify that there are no failures.
- Next, look for the test file matching the domain you are going to change
- Then, Add the new DNS record to the test (copy and paste a similar test. Refer to
EXAMPLES.md
for some samples.) - Run tests and verify that the new record fails
- Make the actual DNS changes
- Run tests again until the failing test now passes.
You may need to wait up to a day for DNS changes to propagate, so you may need to re-run tests every so often.
Here's a useful tool for checking the progress of DNS propagation. To check the propagation of an A record on example.com
, try: https://www.whatsmydns.net/#A/example.com
- Clone this repository
- Install: run
yarn
ornpm install
- Test: run
yarn test
oryarn test