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.