Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building zone files fails for the debian image in docker compose #44

Closed
BifbofII opened this issue Jun 6, 2022 · 1 comment · Fixed by #45
Closed

Building zone files fails for the debian image in docker compose #44

BifbofII opened this issue Jun 6, 2022 · 1 comment · Fixed by #45
Assignees
Labels
bug Bug Report status:confirmed Issue is confirmed

Comments

@BifbofII
Copy link

BifbofII commented Jun 6, 2022

Building the zone file from the DNS_A environment variable seems to fail in the debian image (tag latest) when the container was created by docker compose. When creating a container from the command line, everything works fine, when creating it via docker compose, the hostname -A command here seems to be returning a hostname containing a space (2e520b409724 2e520b409724 in the log below), messing up the zone file syntax.

I don't have any explanation for why hostname would return different things depending on if the container was created by compose or not or why this problem only occurs for debian and not for alpine. Switching to the alpine tag worked as a workaround for me.

dns_1  | [ERR]  Configuration failed.
dns_1  | dns_rdata_fromtext: /etc/bind/custom/zone/rpz:2: near 'admin.2e520b409724': not a valid number
dns_1  | dns_rdata_fromtext: /etc/bind/custom/zone/rpz:11: near '2e520b409724.': extra input text
dns_1  | zone rpz/IN: loading from master file /etc/bind/custom/zone/rpz failed: not a valid number
dns_1  | zone rpz/IN: not loaded due to errors.
dns_1  |
dns_1  | --------------------------------------------------------------------------------
dns_1  | /etc/bind/custom/conf/rpz.conf
dns_1  | --------------------------------------------------------------------------------
dns_1  | zone "rpz" IN {
dns_1  |     type master;
dns_1  |     allow-transfer { any; };
dns_1  |     allow-update { any; };
dns_1  |     file "/etc/bind/custom/zone/rpz";
dns_1  | };
dns_1  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
dns_1  |
dns_1  | --------------------------------------------------------------------------------
dns_1  | /etc/bind/custom/zone/rpz
dns_1  | --------------------------------------------------------------------------------
dns_1  | $TTL 3600
dns_1  | @                               IN   SOA     2e520b409724 2e520b409724. admin.2e520b409724 2e520b409724. (
dns_1  |                                              1654539831     ; Serial number
dns_1  |                                              1200           ; Refresh time
dns_1  |                                              180            ; Retry time
dns_1  |                                              1209600        ; Expiry time
dns_1  |                                              10800          ; Negative Cache TTL
dns_1  | )
dns_1  |
dns_1  | ; NS Records
dns_1  |                                 IN   NS      2e520b409724 2e520b409724.
dns_1  |
dns_1  | ; Custom Records
dns_1  | <domain>               IN   A       <ip>
@cytopia
Copy link
Owner

cytopia commented Jun 7, 2022

@BifbofII thanks for the finding and the detailed analysis. The fix is on the way here: #45

cytopia added a commit that referenced this issue Jun 7, 2022
Refs #44 Do not get all hostname variations on Debian
@dvlbot dvlbot added bug Bug Report status:confirmed Issue is confirmed labels Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug Report status:confirmed Issue is confirmed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants