I am trying to build a sinkhole for BIND. I created a master zone file for malicious domains and created a separate conf file, but I am stuck.
I have a list of known bd domains that is updated nightly. The file simply contains the list of domains, one on each line:
Bad.com
Bad2.com
Bad3.com
...
EOF
I need to add a zone wrapper around each domain, so they look like this:
zone "bad.com" IN { type master; file "/var/named/bad/malware.zone";};
zone "bad2.com" IN { type master; file "/var/named/bad/malware.zone";};
zone "bad3.com" IN { type master; file "/var/named/bad/malware.zone";};
I thought I could use sed to do this, but I can't figure out how to insert in the middle of a line only at the beggining or end.
Any help would be greatly appreciated.