binder
binder copied to clipboard
Resolv host name (NSD back-end)
The NSD back-end passes the server hostname directly to the nsd-control command:
zs_out = subprocess.check_output(
["/usr/sbin/nsd-control",
"-c", self.get_config_path(),
"-s", self.hostname,
"zonestatus"],
stderr=subprocess.STDOUT,
).decode('utf-8')
The problem is that this command is expecting an IP (v4 or v6) address and does not resolve hostnames. This is usually find with DNS servers since they are rather stable and are often used to resolve names for their own domains, however when the DNS server is in another docker container, container names are more stable than IP addresses and it would be really useful to use hostnames rather than IP addresses.