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

Bind9 forward named-* files are truncated after 76 lines when generated through an apache2 proxy #19

Open
raabf opened this issue Sep 15, 2020 · 2 comments

Comments

@raabf
Copy link

raabf commented Sep 15, 2020

Let‘s assume you are running ONA (commit opennetadmin/ona@0ab7fd7 ) on an Apache2 server on port 8666 and this is again proxied via another apache server 1 with the configuration:

<Location /ona>
    RequestHeader unset Accept-Encoding
    ProxyPreserveHost on

    AddOutputFilterByType SUBSTITUTE text/html
    Substitute "s|http://server.example.org/ona|https://server.example.org/ona|ni"

    ProxyPassReverse /
</Location>


ProxyPass /ona http://127.0.0.1:8666/ona/
ProxyPassReverse /ona http://127.0.0.1:8666/ona/
ProxyRequests Off

And dcm.pl is configured to use:

url         => https://server.example.org/ona/dcm.php

Afterwards, the script build_bind at commit 5924d5c is run which builds a bind9 /opt/ona/etc/bind/zone_data/named-sub.example.org zone file, then the file named-sub.example.org is truncated after 76 lines. Of course you need at least 66 entries (first 10 lines are zone file header) for sub.example.org, so that you can see that the file is truncated. The 76 lines of the file are completely correct, just the rest is missing.
This error does not affect reverse lookup files, i.e. named-*.ip6.arpa or named-*.in-addr.arpa files; they are complete and can exceed 76 lines.
I have no idea why exactly 76 lines, but the number seems to be constant and not changing.

When I remove the proxy, i.e. configure dcm.pl to use:

url         => http://127.0.0.1:8666/ona/dcm.php

then named-sub.example.org is complete and does exceed 76 lines, so the problem arises really by using the proxy. I did not observe any other problems with the proxy.

When you read until this point and think, this cannot be and is wired behavior, especially the 76 lines, then I agree. But I had this problem already ~2 years ago, forgot it meanwhile, and configured now a server again with a proxy and the same problem occurs, so I can reproduce it on a second machine.
By the way, The apache proxy is just nice, I have no issues to run build_bind directly on http://127.0.0.1:8666/ona/ , just want to document the problem here.

1: When you wonder whey I am doing this, the first Apache server is running in a docker container.

@MegaAndrey
Copy link

By the way, has anyone been able to solve this problem? I am not using proxy but the problem is present. I noticed that the file cannot be more than 8 kilobytes. Is this due to some limitations of the perl?

@MegaAndrey
Copy link

Problem was solved by replacing Centos 8 to Centos 7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants