Abstract illustration
Blog Engineers Corner

Which DNS records are best for easy listening?

Have you ever broken a chair arm, the passenger side mirror or even a car window? Well for any of you that have, I am almost certain duct tape was your g-to tool for solving the issue. Duct tape has been such an important tool in the growth of the human race that us humans have decided to honor duct tape by finding more respectable uses for it. Some great ways you can honor duct tape are using a duct tape wallet or creating a stylish duct tape tie. While duct tape really is amazing this blog post isn’t suppose to be about duct tape so let me refocus. Like Duct tape (see what I did there), the Domain Name System, or DNS, is an integral tool that keeps the interwebs from spiraling out of control. Just imagine, without DNS, instead of saying things like “Dude just google it!” it would be “Dude just 172.217.6.46 it!” (I know technically the IP would be different based on your geolocation but just go with it ok). If you think that’s bad just imagine if IPv6 ever catches on ;). So like duct tape I feel it is my duty as a patron of the interwebs to honor DNS by creating the DNSynth – a synth/music maker that uses DNS records to build a tune. Alright, well I have absolutely no musical ability nor, do I know the first thing about music theory. In fact my last foray into music was second grade when I had to play hot cross buns on the recorder. I didn’t fail or anything but I was in second grade. To get started on the DNSynth, my first thought was: What do I know about music? It basically boiled down to the following:

  • Sounds are waves
  • Multiple waves with different frequencies will overlap and create beats (thanks high school physics)
  • Beats are what rappers drop you see rappers dropping beats on MTV
  • MTV stands for Music TV
  • Now that I figured out how to create music, I remember an old script I wrote many years back that I think will be a perfect starting point. My trusty wardialer script. My war dialer script is perfect because it has the ability to generate tones using multiple frequencies; aka drop beats.

I now just have to add the following logic to transform my war dialer into a dnsynth:

  • It parses out the host and the address from DNS records and create a unique hash
  • It uses the hash to decide if the given record will play 2, 4 or 8 notes sequentially
  • It uses the hash to decide the duration of each note
  • it plays the sequence before looking at the next record

Here is a link to dnsynth.py. Like every great program there are dependencies you will need. In this case you will need to install pygame and numpy. One of my favorite DNS record tunes is microsoft.com. To listen to it simply run the following:

  • Download dnsynth.py from the link above
  • Pip install pygame
  • Pip install numpy
  • Install dig. Debian users can do
  • Sudo apt-get install dig
  • Then run: dig microsoft.com | python dnsynth.py

You may be asking yourself is this really music? I will answer you with the following statement: When Robert Moog created his first frequency modulating synth and show his mom what he had done, What do you think she said? Well I don’t actually know but I do know she did not say “Oh that sounds amazing I am sure your synth will spark entire new genre”. I don’t think Robert Moog even knew what impact his creation would create. I don’t actually think DNSynth is going to catch on, but maybe like the duct tape wallet wiki howto link I have created some unique content for this blog that can get crawled, backlinked and bump up our SEO score 1000th of a point.