Article 5SE0V Script question for BIND

Script question for BIND

by
dupa
from LinuxQuestions.org on (#5SE0V)
I need to or want to delete BIND DNS entries that match A records from another file. If the DNS entry has multiple records associated to it in File2, those need to remove too.

File1
  • car.example.com 192.168.10.1
  • truck.example.com 192.168.10.2
  • bike.example.com 192.168.10.5
File2
  • car.example.com 192.168.10.1, 192.168.10.10, 192.168.10.20
  • truck.example.com 192.168.10.2
  • bike.example.com 192.168.10.5, trek.example.com
After the removal, I need or would like to add new entries for the entries that were removed into File2.
  • car.example.com 172.10.1.12
  • truck.example.com 172.10.1.15
  • bike.example.com 172.10.2.20
I tried a few grep. awk commands etc. I was able to remove the entry but not if the entry had multiple entries associated to it. However when I tried to start named.service it would fail.

Code:grep -vwf file1 file2Code:grep -f <(cat file1 | sed 's/^/^/' ) file2latest?d=yIl2AUoC8zA latest?i=FBznz4fqxSA:5diMjvcUz7s:F7zBnMy latest?i=FBznz4fqxSA:5diMjvcUz7s:V_sGLiP latest?d=qj6IDK7rITs latest?i=FBznz4fqxSA:5diMjvcUz7s:gIN9vFw
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments