Changeset 708
- Timestamp:
- 03/09/16 14:09:07 (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r707 r708 222 222 template_skip_0 => 0, # publish .0 by default 223 223 template_skip_255 => 0, # publish .255 by default 224 # allow TXT records to be dealt with mostly automatically by DNS server? 225 autotxt => 1, 224 226 ); 225 227 … … 252 254 # Several settings are booleans. Handle multiple possible ways of setting them. 253 255 for my $boolopt ('log_failures', 'force_refresh', 'lowercase', 'usecache', 254 'template_skip_0', 'template_skip_255' ) {256 'template_skip_0', 'template_skip_255', 'autotxt') { 255 257 if ($self->{$boolopt} ne '1' && $self->{$boolopt} ne '0') { 256 258 # true/false, on/off, yes/no all valid. … … 1852 1854 $cfg->{template_skip_0} = $1 if /^template_skip_0\s*=\s*([a-z01]+)/i; 1853 1855 $cfg->{template_skip_255} = $1 if /^template_skip_255\s*=\s*([a-z01]+)/i; 1856 $cfg->{autotxt} = $1 if /^force_refresh\s*=\s*([a-z01]+)/i; 1854 1857 # not supported in dns.cgi yet 1855 1858 # $cfg->{templatedir} = $1 if m{^templatedir\s*=\s*([a-z0-9/_.-]+)}i; … … 6264 6267 # trying to interpret DNS data at all. 6265 6268 6266 print $datafile ":$host:16:"; 6267 my @txtsegs = $val =~ /.{1,255}/g; 6268 foreach (@txtsegs) { 6269 my $len = length($_); 6270 s/:/\\072/g; 6271 printf $datafile "\\%0.3o%s", $len, $_; 6272 } 6273 print $datafile ":$ttl:$stamp:$loc\n"; 6274 6275 # $val =~ s/:/\\072/g; # may need to replace other symbols 6276 #make this an option? 6277 # print $datafile "'$host:$val:$ttl:$stamp:$loc\n" or die $!; 6269 if ($self->{autotxt}) { 6270 # let tinydns deal with splitting the record. note tinydns autosplits at 127 6271 # characters, not 255. Because Reasons. 6272 $val =~ s/:/\\072/g; # may need to replace other symbols 6273 print $datafile "'$host:$val:$ttl:$stamp:$loc\n" or die $!; 6274 } else { 6275 print $datafile ":$host:16:"; 6276 my @txtsegs = $val =~ /.{1,255}/g; 6277 foreach (@txtsegs) { 6278 my $len = length($_); 6279 s/:/\\072/g; 6280 printf $datafile "\\%0.3o%s", $len, $_; 6281 } 6282 print $datafile ":$ttl:$stamp:$loc\n"; 6283 } 6278 6284 6279 6285 # by-hand TXT -
trunk/dnsdb.conf
r670 r708 49 49 #showrev_arpa = 0 50 50 51 # Let DNS server autosplit long TXT records however it pleases, or hand-generate the split points? 52 #autosplit = 1 51 53 52 54 ## General RPC options
Note:
See TracChangeset
for help on using the changeset viewer.