4

I've set up a slave DNS server on Linux using bind. On starting the named service the zone files transffered to slaves/ but the information in the files looks like its in strange computer symbols (i'm not sure what the correct term is for this) where there are symbols and squares like the snippet below.

Does anyone know what may have caused this? Have I missed an important step?

enter image description here

neilH
  • 937
  • 1
  • 6
  • 16
  • At first glance that looks more like a terminal issue (a mismatch between the encoding of a file (system) and your terminal settings for instance) but does your slave function correctly? i.e. do queries with `dig` get answered correctly? – HBruijn Sep 12 '16 at 15:57
  • @HBruijn Hi, On the slave DNS I am getting an output for `dig -x 10.100.x.x` . I thought this may be resolving from the master DNS server so I've now commented out all lines in /etc/resolve.conf and the `dig -x 10.100.x.x` command still works. Does this mean the slave DNS is working ? I.e. is this what is resolving the ip address? – neilH Sep 12 '16 at 16:15
  • I've come to the conclusion that it is resolving correctly so your suggestion that it may be a mismatch with file encoding seems appropriate. How would I go about checking/changing this? – neilH Sep 12 '16 at 16:21

2 Answers2

3

This is default behaviour for Bind 9.10 (at least). See ftp://ftp.isc.org/isc/bind9/cur/9.10/doc/arm/Bv9ARM.ch06.html#zone_statement

masterfile-format
Specifies the file format of zone files (see the section called

“Additional File Formats”). The default value is text, which is the standard textual representation, except for slave zones, in which the default value is raw.

If you need to examine the contents of the zone files on the slave you can either change this setting (to "text") in your config file or use named-compilezone to dump the contents.

Paul Haldane
  • 4,457
  • 1
  • 20
  • 31
2

You haven't done anything wrong. With BIND 9.9 and onward, zones of type slave are stored on disk in raw binary format. The assumption is that humans should only need to manually tweak the contents of a zone file on the masters. You can read more about the various formats here.

If all you're interested in doing is validating the data that was replicated to the secondary server (and comparing serial number in the SOA record isn't enough), you can use named-compilezone to convert the file back to text format:

$ file example.com.zone
example.com.zone: data
$ named-compilezone -f raw -F raw -o example.com.zone.out example.com example.com.zone
zone example.com/IN: loaded serial 2016090801
dump zone to example.com.out...done
OK
$ file example.com.zone.out
example.com.zone.out: ASCII text

I was going to elaborate on changing the zone file format, but Paul beat me to the punch on that one. I would encourage you to leave that alone unless necessary for some form of automation. Usually it is enough to compare the serial numbers of the loaded zone.

Andrew B
  • 31,858
  • 12
  • 90
  • 128
  • Cheers for the info, your answer was also relevant, as you say beaten to the punch, you'll fight another day! – neilH Sep 13 '16 at 09:33