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
Reverse DNS records are broken #127
Comments
Oh sorry, my change would look like this if (!(preg_match("/in-addr.arpa/i", $zone)) && !(preg_match("/$zone$/i", $name))) { in dns.inc.php: validate_input Tested and it works as expected but I want to make sure its desirable. |
I have seen this issue before, but can't reproduce it with the latest code. Also it's not clear how you was able to add 2.171.110.38.in-addr.arpa and 2.171.110.38.in-addr.arpa. records to 171.110.38.in-addr.arpa zone. Maybe you can provide detailed steps? |
I ran into this recently, really nasty when you run a production system with poweradmin... We have partial rdns zones, and the / in them messes with the preg_match like $zone = "224/27.194.28.217.in-addr.arpa"; preg_match will fail. The fix above works. |
@siberian1967: how you was able to add reverse zone with dot at the end from Poweradmin? |
I ran into this same problem, still happens even in a fresh clone from git. Above suggested solution seems to completely stop it from appending the domain name when adding or updating a record in a sub-delegated reverse zone. The regex delimiter just needs to be changed to something other than "/" so it doesn't conflict with any "/"s in the strings. This did the trick for me and passed internal QA:
|
just don't do suffix string checks (i guess that is what is supposed to do, right?) with preg hacks; see http://stackoverflow.com/questions/834303/startswith-and-endswith-functions-in-php for some "real" solutions. |
Merged #247 so can be closed |
Reverse delegated zone example: 171.110.38.in-addr.arpa.
Records are PTR like this:
2.171.110.38.in-addr.arpa
and
2.171.110.38.in-addr.arpa.
When you 'Commit' changes dns.inc.php munges them
What this does is change the above examples to:
2.171.110.38.in-addr.arpa.171.110.38.in-addr.arpa (it added the name)
and
2.171.110.38.in-addr.arpa (It stripped the period)
Change nothing and hit commit again and they become
2.171.110.38.in-addr.arpa.171.110.38.in-addr.arpa.171.110.38.in-addr.arpa (it added the name again)
and
2.171.110.38.in-addr.arpa.171.110.38.in-addr.arpa (It added the name)
And so on and so forth forever.
A quick fix for this is to change the above codeblock to ignore this munging if its an in-addr.arpa record.
Before I submitted a PR for this I wanted to me sure this was not intentional and that I was not missing a bigger picture.
Tx (this broke our network something fierce today, 2000 upset customers. sigh.).
The text was updated successfully, but these errors were encountered: