Linux – Resolve domain to another domain’s IP on Linux via local DNS

domain-name-systemdyndnsinternal-dnslinux

I have a local domain name "SomeName" and an Internet domain "AnotherName.dyndns.org" whose IP can change at any time (it uses a dynamic DNS). I want to resolve "SomeName" to "AnotherName.dyndns.org"'s IP. In other words, if "AnotherName.dyndns.org" points to 1.2.3.4, I want "SomeName" to point to that same IP, namely 1.2.3.4.

Is there any easy and straightforward way to achieve this? I couldn't find such an option for DNSMasq or BIND. I suppose one could write a script that gets the domain's IP and rewrites the config file, then reloads the DNS server, but that would be so ugly.

Why do I want this? To put it simply, I want to setup a Bacula server and client. The server has to resolve "SomeName" to a local IP (static, no problem here) and the client has to resolve it to a public IP (dynamic, namely "AnotherName.dyndns.org").

Best Answer

If I understand correctly, what you want is a CNAME DNS record:

http://en.wikipedia.org/wiki/CNAME_record