AXFR from Bind oddities

DAve <[email protected]> Mon, 12 Apr 2010 09:12:04 -0400
Newsgroups gmane.network.djbdns
Message-ID <[email protected]>
Good morning,

We have a client that we routinely AXFR zone from. They use Bind inside
their network and we AXFR zone when they send us a notify, load the zone
into VegaDNS, and then populate our tinydns data files.

We are running into a issue with TXT records where extra characters
appear in the records. The client is editing their zone files with VI
and their Bind server answers with a correct record. When we do an AXFR
though, the data file created by axfr-get has odd characters in the TXT
file line. This is only happening with one client.

Example,
:djgusa.com:16:Zv\075spf1 <snip>
Why is the "Z" in "16:Zv"?

:djgusa.com:16:\136spf2.0 <snip>
Why is the "\136" in "16:\136spf2"?

Currently I am filtering out the oddities with a preprocessor script but
it is becoming a chore as the characters do not remain the same, and do
not always appear in every TXT record.

This is the current list of filters I have in place, and it's growing.

    }elsif($id eq ":"){
      if($debug){print "'$data[0]' '$data[1]' '$data[2]' '$id' '$line'\n";}
      if($data[2] eq "16"){
        $data[3] =~ s/Nv\\075/v=/;
        $data[3] =~ s/\\040/ /g;
        $data[3] =~ s/\\042//g;
        $data[3] =~ s/\\073//g;
        $data[3] =~ s/\\072/:/g;
        $data[3] =~ s/\\176/~/g;
        $data[3] =~ s/\\057/\//g;
        $data[3] =~ s/\\015//g;
        $data[3] =~ s/\\222//g;
        $data[3] =~ s/\\173//g;
        $data[3] =~ s/\\174//g;
        $data[3] =~ s/\\075/=/g;
        $data[3] =~ s/\\037v=/v=/g;
        $data[3] =~ s/\\3v=/v=/g;
        $data[3] =~ s/\\211v=/v=/g;
        $data[3] =~ s/\\213v=/v=/g;
        $data[3] =~ s/\\227v=/v=/g;
        $data[3] =~ s/\\243v=/v=/g;
        $data[3] =~ s/\\247v=/v=/g;
        $data[3] =~ s/\\247spf/spf/g;
        $data[3] =~ s/\\136spf2/spf2/g;
        $data[3] =~ s/\\Zv=spf1/v=spf1/g;
        $data[3] =~ s/\\210k=/k=/g;
        $data[3] =~ s/\\011t=/t=/g;
        $host = $data[1];
        $type = 'T';
        $val = $data[3];
        $distance = '';
        $ttl = $data[4];

I am open to any suggestions as to where these characters are coming
from, and how to stop them from getting into the data record.

Thanks,

DAve

-- 
"Posterity, you will know how much it cost the present generation to
preserve your freedom.  I hope you will make good use of it.  If you
do not, I shall repent in heaven that ever I took half the pains to
preserve it." John Adams

http://appleseedinfo.org