On CNAMEs

This is just a quick note so I hate myself less later for CNAME’s.

CNAME stand for canonical name and is a stand-in reference for another node. You see them used all the time like so
land.bob.com in A 127.0.0.1
grass.bob.com IN CNAME land.bob.com
dirt.bob.com IN CNAME land.bob.com

These records basically say both dirt and grass are same names for land and all of them can be found at 127.0.0.1 aka home. Cool, handy for piddly deploys but let’s say bob wants a house on his grass.

land.bob.com in A 127.0.0.1
grass.bob.com IN CNAME land.bob.com
dirt.bob.com IN CNAME land.bob.com
house.grass.bob.com IN CNAME land.bob.com

This is against internet best practices as
grass is a node of bob which is a node of com and a node if identified as a CNAME is the last answer for the node grass and house should not return. Unfortunately explaining this to both bob and myself most dns companies don’t do as as far as I can tell they don’t walk the nodes like that anymore. I’m still getting to the bottom of it and may spin up a test at some point but keep in mind that if you need any additional records at a node it can’t be a cname so this works

land.bob.com in A 127.0.0.1
grass.bob.com IN A 127.0.0.1
dirt.bob.com IN CNAME land.bob.com
house.grass.bob.com IN CNAME land.bob.com

Yes ALIAS records or other names do exist and could be used here but ye be warned of the danger that they aren’t standard.

Leave a Reply

Your email address will not be published. Required fields are marked *