If you use pdnsutil add-record it permits duplicate dns entries to be created. Is there some way to prevent this?
Asked
Active
Viewed 1,184 times
1 Answers
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,369
- 4
- 41
- 75