Hello,
I have a medium amount of hosts and need to automate registering the clients. The problem I am facing is that the hosts have alphanumerical names (vm123), but are registered under the name of the customer who has rented that particular vm. This means “customer.com CNAME vm123.domain.com” in my DNS. hostname -f gives me the FQDN which I could use in a script triggered by ansible. But I have no idea how to get the alias. Nslookup customer.com shows that it is an alias and then proceeds to resolve vm123. Is there any way I could do the reverse? I am playing with the thought of getting the hostname from the server_name in the nginx config, but I sometimes have multiple server names and I don’t see a way to identify the domain used for registering. The other configured domains are mostly subdomains for specific services.
Yours sincerely
Stefan