Default schema too short for valid DNS records, plus bad behavior when a record too long found #218

Closed
Habbie opened this Issue Apr 26, 2013 · 2 comments

Projects

None yet

1 participant

@Habbie
Member
Habbie commented Apr 26, 2013

We did some tests with a very long SOA record, and PowerDNS died and could not restart.

/var/log/messages showed:

Jan 16 16:30:18 cory pdns[3609]: Initiating transfer of 'name' from remote '207.219.45.37:51014'
Jan 16 16:30:18 cory pdns[3609]: gpgsql Connection succesful
Jan 16 16:30:18 cory pdns[3609]: AXFR started for 'name', transaction started
Jan 16 16:30:18 cory pdns[3609]: Communicator thread died because of error: PostgreSQL failed to execute command: ERROR:  value too long for type character varying(255)
Jan 16 16:30:18 cory pdns[3609]: gpgsql Connection succesful
Jan 16 16:30:19 cory pdns[3606]: Our pdns instance exited with code 0
Jan 16 16:30:19 cory pdns[3606]: Respawning

After respawning PowerDNS did not answer any queries at all. :(

The problem was a very long SOA record. The record in question was an SOA like this:

. abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijj.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijj.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijj.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefgh. 11 300 604500 604800 600

I changed the schema to have 1023 instead of 255 characters for the "content" column in the "records" table, restarted PowerDNS, and now everything is happy.

So, there are two problems:

  1. The default schema should be tweaked to allow larger records. I don't know what the DNS maximum record size is, but clearly 255 is not enough.
  2. PowerDNS needs to handle this failure better. Preferably not restarting, but if so at least doing so without error.

Shane Kerr [[BR]]
shane@ca.afilias.info

@Habbie Habbie was assigned Apr 26, 2013
@Habbie Habbie closed this Apr 26, 2013
@Habbie
Member
Habbie commented Apr 26, 2013

Author: peter
content fields in most backends now default to around 4kilobyte. This covers issue 1. Please report whether issue 2 still applies, 3 years is a long time and I know AXFR issues do not currently tend to kill PDNS.

@Habbie
Member
Habbie commented Apr 26, 2013

Author: peter
Issue 2 should have been fixed with r2476.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment