I would like to use our internal DNS server for linking names from provisioning to final use. So I imagine it like this.
A server comes into our network and gets a DHCP or a static address and then has a DNS entry with its hardware name, for example ilocz1234xyz with an HP server. Later the server is provisioned and gets a name and a function in the process. I would like to merge these names. we are currently doing this by giving the server a name during provisioning, for example pegasus in the DNS we then create the names:
- ilocz1234xyz.example.com
- ilo.pegasus.example.com
- pegasus.example.com
After that, the server is installed by the OP team with a specific role and gets a working name, for example "webserver" and the DNS entries are adjusted:
- ilocz1234xyz.example.com
- ilo.pegasus.example.com
- pegasus.example.com
- webserver.example.com
My question now is how do I get the names to be referenced, so that I can see the names belong together. I initially thought it like this:
- ilocz1234xyz.example.com A record -> 10.0.0.100
- ilo.pegasus.example.com C-NAME -> ilocz1234xyz.example.com
- pegasus.example.com A record -> 10.0.0.200
- webserver.example.com C-NAME -> pegasus.example.com
My goal now is that I can make a query on pegasus.example.com and then get the entries for ilo.pegasus.example.com and webserver.example.com but that doesn't work because CNAME is just an alias and I cannot search DNS recursively. You could certainly also write a script that queries the DNS and collects all the data for me, but my question is whether there is an easier way to solve this, maybe even with on-board tools.