- Timestamp:
- 01/18/16 10:12:04 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r701 r703 6240 6240 6241 6241 ($host,$val) = __revswap($host,$val) if $revrec eq 'y'; 6242 ##fixme: split v-e-r-y long TXT strings? will need to do so for BIND export, at least 6243 $val =~ s/:/\\072/g; # may need to replace other symbols 6244 print $datafile "'$host:$val:$ttl:$stamp:$loc\n" or die $!; 6242 # le sigh. Some idiot DNS implementations don't seem to like tinydns autosplitting 6243 # long TXT records at 127 characters instead of 255. Hand-crafting a record seems 6244 # to paper over the remote stupid. We will NOT try to split on whitespace; the 6245 # contents of a TXT record are opaque and clients who can't deal are even more broken 6246 # than the ones that don't like them split at 127 characters... because BIND tries 6247 # to "intelligently" split TXT data, and abso-by-damn-lutely generates chunks <255 6248 # characters, and anything that can't interpret BIND's DNS responses has no business 6249 # trying to interpret DNS data at all. 6250 6251 print $datafile ":$host:16:"; 6252 my @txtsegs = $val =~ /.{1,255}/g; 6253 foreach (@txtsegs) { 6254 my $len = length($_); 6255 s/:/\\072/g; 6256 printf $datafile "\\%0.3o%s", $len, $_; 6257 } 6258 print $datafile ":$ttl:$stamp:$loc\n"; 6259 6260 # $val =~ s/:/\\072/g; # may need to replace other symbols 6261 #make this an option? 6262 # print $datafile "'$host:$val:$ttl:$stamp:$loc\n" or die $!; 6245 6263 6246 6264 # by-hand TXT
Note:
See TracChangeset
for help on using the changeset viewer.