Closed eleaner closed 2 years ago
Why are you including the dns name twice? It is intended to be a pair hostname=ipaddress,...
EXTRA_HOSTS=mywebserver.loc=172.16.238.1 https://devilbox.readthedocs.io/en/latest/advanced/add-custom-cname-records.html?highlight=extra%20hosts
and, to match that to your case:
-e EXTRA_HOSTS='hetzner1=10.8.0.5,hetzner2=10.8.0.9'
Please see section 5. Adding reverse DNS:
https://github.com/cytopia/docker-bind#extra_hosts
The following extra host 'my.host' is added and will always point to whatever IP example.org resolves to. As well as adding reverse DNS from 192.168.0.1 to resolve to tld EXTRA_HOSTS='tld=192.168.0.1=tld'
my requirement is to resolve hetzner1 -> 10.8.0.5 as well as 10.8.0.5 -> hetzner1 and it works as long as I have only one entry
Oh, I'm sorry. It looks like the developer added a feature I didn't know about.
I can confirm this bug. I'm going to send some additional information to the developer to help speed this up.
@cytopia: eleaner has found a bug with multiple extra_hosts with reverse lookup.
If you do:
EXTRA_HOSTS=test.loc=172.16.238.42=test.loc,test2.loc=172.16.238.43=test2.loc
(as long as both ip addresses are in the same subnet)
The configuration it creates returns an error:
/etc/bind/devilbox-extra_hosts.test2.loc.conf:7: zone '238.16.172.in-addr.arpa': already exists previous definition: /etc/bind/devilbox-extra_hosts.test.loc:7
This is caused by always adding in a zone for the subnet for every extra host with reverse: https://github.com/cytopia/docker-bind/blob/master/data/docker-entrypoint.sh#L248
I'm not sure what you were solving by adding that subnet zone, but you might want to track witch subnets you've added a zone and not add duplicate zones.
Good catch. I will probably have to create multiple zones then
Since this is mostly intended for internal use, adding the reverse zone could be implicit for all cases? Just a thought
Is there already a way to get the reverse-lookup working again? Is there also a way to round-robin load-balance with this dns-server?
Thanks for creating this really nice image, by the way.
@eleaner @science695 @dimkasta @mboehm21
thanks for the issue. I have made a major rewrite which addresses the fix here: https://github.com/cytopia/docker-bind/pull/36
following the readme, I try to resolve two hosts like below
and I get following log with error error - docker service fails
Everything is working fine with only one specified host. If I try to define EXTRA_HOST twice, the last one wins