Actions
Bug #23352
openRegistration of DNS PTR records does not support trailing dots in FQDN
Status:
New
Priority:
Normal
Assignee:
-
Category:
DNS
Target version:
-
Description
I am using Foreman Proxy to register DNS entries using the API.
Issue:
When trying to register a reverse DNS entry (PTR record) I do receive the following error:
Invalid reverse DNS 51.50.168.192.in-addr.arpa.
Solution:
Looking into the code i see that the trailing dots in PTR FQDNs are not permitted, although they should.
The following patch will solve the issue:
cd /usr/share/foreman-proxy/modules/dns patch -p0 dns_api.rb << '@EOF' *** dns_api.rb 2018-04-03 13:04:42.000000000 +0200 --- dada 2018-04-22 06:17:01.601331980 +0200 *************** *** 79,85 **** def validate_reverse_dns_name!(name) validate_dns_name!(name) ! raise Proxy::Dns::Error.new("Invalid reverse DNS #{name}") unless name =~ /\.(in-addr|ip6)\.arpa$/ end end end --- 79,85 ---- def validate_reverse_dns_name!(name) validate_dns_name!(name) ! raise Proxy::Dns::Error.new("Invalid reverse DNS #{name}") unless name =~ /\.(in-addr|ip6)\.arpa\.?$/ end end end @EOF
Updated by Lukas Zapletal over 6 years ago
Thanks a lot, are you planning a PR in https://github.com/theforeman/smart-proxy/pulls? A simple unit test would be required.
Updated by Sven Lueder over 6 years ago
Hi Lukas,
yep, will do so.
Best regards
Sven
Actions