0

If you use pdnsutil add-record it permits duplicate dns entries to be created. Is there some way to prevent this?

ethrbunny
  • 2,327
  • 4
  • 36
  • 72

1 Answers1

1

I cheated (a bit) on this one. I need a way to map my forward zone to a reverse zone and run it via script.

My setup uses mysql as the back end so I changed the records table as follows:

alter table records add constraint dom_type_co unique (domain_id, type, content);

Now if I try to create a duplicate record I get an error msg:

Error: GSQLBackend unable to feed record: Could not execute mysql statement ...


As an aside - to map a forward zone to a reverse:

pdnsutil list-zone mydom | grep "10\.95\.96" | awk '{ printf "%s %s\n",$5,$1 }' | cut -c 10- | xargs -L 1 pdnsutil add-record 96.95.10.in-addr.arpa $1 PTR $2

Obviously you'll need to change it to fit your IP address/length.

ethrbunny
  • 2,327
  • 4
  • 36
  • 72