With refactoring the get_reverse_domain_name
function, we change the reverse domain checking to
a reverse order. In this way we check the lowest class
(more specific) reverse zone first. When an existing domain found we use it to create the reverse PTR records. If no one existing can be find, The most specific address will be used.
In this way the reverse it is possible to create
auto-ptr records in higher ip classes (eg. class A in IPv4).
Only works with existing higher class domain.
If is isn't find higher class domain, create a lowest class domain, and add there the reverse PTRs.
Also works with IPv6!
iteratively checking of existing domains with higher IP
classes. When this function find an existing higher class
domain return with that reverse address. eg. 192.in-addr.arpa
If it is not find any existing higher class domain it returns with the lowest class domain reverse domain name. eg, 39.168.192.in-addr.arpa
With this modification it can be possible, to detect
custom IP classes for domains. It just need to
modify the multipler in regexp {4} or {1}.
In the future it will works automaticly, but not now
Because this bug domain deleting isn't possible when
a domain specific attribute is set (eg. dyndns).
This modification delete domain settings before domain
deleting.
First of all we cut all of dot char at the end of the rstring and than we put one there.
this way we make sure that our string contains just
one dot at its end.
When a record successefully added to a domain, it will
try to create a reverse lookup domain for that record.
In this point we aren't create the records yet...
This function will create automatically the reverse lookup
domain for the applied record of a Domain.
And also grant the privileges from the original Domain.
If we try to check if a domain exists, and we fetch with
get_id_by_name() function it will return with None if
the domain not exists, and return the id when yes.
Depending on the database backend the string might not be UTF-8 encoded.
This makes sure that the hashing function works regardless of that.
Signed-off-by: Felix Kaechele <felix@kaechele.ca>
Using env enables the scripts to run in virtualenv as well as in a
differently named or bare environment.
Signed-off-by: Felix Kaechele <felix@kaechele.ca>
If LOG_FILE config option contained invalid file, pdns admin wouldn't start.
Also, it wasn't possible to log only to stdout/stderr correctly, because
setting the log file to /dev/stdout would double the logs messages as the pdns
admin is already logging to the stderr.