-
Notifications
You must be signed in to change notification settings - Fork 46
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
pdns_record keeps looping #169
Comments
@trefzer do you know why this can happen? |
We observed something similar. |
I've had similar issues with
which never matched the output of pdnsutil, which instead produced output like:
After applying this change locally, I'm no longer seeing any zones re-imported unless their records actually differ. |
Okay now I can't trigger the bug with the old code, so something else has changed. |
In your case it's more likely that there is some log output or something else extraneous in the |
I'm curious if this is related to a PowerDNS change or if it's an actual bug in the code that has never worked in the past. We're not using it ourselves so it's difficult for me to verify this. |
Okay, so, step back and some clarity on the more generalised issue: We're currently running PowerDNS 4.8.3 with the PostgreSQL backend. Examining the PowerDNS database, it appears that PowerDNS never stores records internally with a trailing
When fetching zones with
The
The The same confusion affects
Though the record is correctly queried with trailing As a separate issue, PowerDNS records that are imported with uppercase characters in the Since
Any resource that fails these rules will still be accepted by PowerDNS and will still work just fine, but any affected zones will be marked as requiring correction by Puppet on every run, because the Since PowerDNS' behaviour is inconsistent across different record types, it doesn't necessarily feel correct to enforce these rules in the resources themselves, but failing to be aware of them means that people are going to end up with lots of endlessly repeated resources that change nothing but the zone serial. The other thing that can happen, as mentioned earlier, is that setting Unfortunately, the command execution context defined by the I don't know if the behaviour of |
https://doc.powerdns.com/md/types/ says:
From the PowerDNS source: static int listZone(const DNSName &zone) {
UeberBackend B;
DomainInfo di;
if (! B.getDomainInfo(zone, di)) {
cerr << "Zone '" << zone << "' not found!" << endl;
return EXIT_FAILURE;
}
di.backend->list(zone, di.id);
DNSResourceRecord rr;
cout<<"$ORIGIN ."<<endl;
cout.sync_with_stdio(false);
while(di.backend->get(rr)) {
if(rr.qtype.getCode()) {
if ( (rr.qtype.getCode() == QType::NS || rr.qtype.getCode() == QType::SRV || rr.qtype.getCode() == QType::MX || rr.qtype.getCode() == QType::CNAME) && !rr.content.empty() && rr.content[rr.content.size()-1] != '.')
rr.content.append(1, '.');
cout<<rr.qname<<"\t"<<rr.ttl<<"\tIN\t"<<rr.qtype.toString()<<"\t"<<rr.content<<"\n";
}
}
cout.flush();
return EXIT_SUCCESS;
} Which suggests that the record types that require a trailing |
@Longsight first of all, thanks for the thorough explanation! I agree this would be the best way forward for now. I'm not sure yet if this will solve the issue @maxadamo is facing as he had an issue with A-records, but it's definitely something that needs fixing. Considering the amount of time you already spent on this I'm a little hesitant to ask, but is it something you could PR you think? Ps. I can confirm the behaviour of |
I'll refresh my memory of the type/provider API and have a look at this tonight, yeah. |
Without further investigation I can't say for sure, but if @maxadamo has |
@Longsight I'm using the default loglevel. I'm not understanding what is the default, but the log files are pretty much empty. |
@maxadamo what do you get when you run |
Essentially this is a question of comparing the output of that command with the expected output that the provider builds from the resources - if there are unexpected lines in the output, then it'll never match and always refresh the resource. |
@Longsight there you go. Why do I see bindbackend? # pdnsutil list-zone dumb.zone
Apr 26 17:24:29 [bindbackend] Done parsing domains, 0 rejected, 0 new, 0 removed
$ORIGIN .
dumb-record.dumb.zone 3600 IN A 192.168.1.10
dumb.zone 3600 IN SOA a.powerdns.server hostmaster 4 10800 3600 604800 3600 but, why do I see bindbackend, if I declared sqlite only? class { 'powerdns':
recursor_version => $pdns_major_version,
recursor => true,
backend => 'sqlite';
} |
for me it was solved removing the package # pdnsutil list-zone dumb.zone
$ORIGIN .
dumb-record.dumb.zone 3600 IN A 192.168.1.10
dumb.zone 3600 IN SOA a.powerdns.server hostmaster 4 10800 3600 604800 3600 |
would it be an option to uninstall backends that have not been declared in the module? |
It's automatically purged if the chosen backend is The default backend in the module is |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We get that this might not be what you had expected but we're trying to limit stale as issues as much as possible. Thank you for your contributions. |
My backend is sqlite3.
I have this entry to create a zone:
And I tried all of these, with the same result: it keeps adding the record again and again. although the record is present and it's working.
Setting
manage_record
to false works, but I don't know if this is the intended:am I doing something wrong?
The text was updated successfully, but these errors were encountered: