Stupid DNS tricks
Published October 27, 2019
The late night talk show host David Letterman used to have a segment called Stupid Pet Tricks. Well, these tricks aren't stupid but it's a fun name.
Cheaping out
You can buy a cheap nameserver on a site like NameSilo, but use something better like Route 53 for management of the actual site.
See this link.
DNS fun
DNS can be very mysterious. You don't know, did my change take effect? How long will I have to wait before it does? On a Mac, you can use networksetup -setdnsservers Wi-Fi
to quickly test DNS changes. When you're done, use networksetup -setdnsservers Wi-Fi Empty
to revert back.
NOTE: In my experiments, I found that setting specific name servers can completely take down your computer's ability to access the internet, albeit the hostname of the site you're trying to configure. You've been warned!
In AWS Route 53, they let you enter TXT records. What does that give you? The ability to enter free text to validate the route you think you're hitting. The host
command helps with that.
host -t TXT bellagrams.org
So with this knowledge, you can test your DNS changes with something like this:
- Create your new hosted zone entry on Route 53
- To see changes quickly, change the TTL on your
A
andNS
records to be something low (say 60 seconds). Do this on both Route 53 and your old nameserver provider. - Use
networksetup -setdnsservers Wi-Fi
to point to Route 53 DNS servers - You can validate these settings by executing
cat /etc/resolv.conf
- Use
host -t TXT
against your hostname to validate the text doesn't show up - Add a TXT entry for that hosted zone with some fun text ("Hello, world!")
- Try
host -t TXT
and ensure your changes have been propagated - Change the nameservers on your old name server host to point to AWS name servers
- Use
networksetup -setdnsservers Wi-Fi Empty
to revert back
Now you have the tools needed to ensure that your DNS config understanding matches reality.
Go back to the homepage