I am in need of generating a csv/txt file from a zone file on a named DNS server.
For examples I would like to generate a list of the hostname and IP from the zone file
monkey A 192.168.1.1 bear A 192.168.1.2 shark A 192.168.2.1 bird A 192.168.3.1 lion A 192.168.4.1
monkey,192.168.1.1 bear,192.168.1.2 shark,192.168.2.1 bird,192.168.3.1 lion,192.168.4.1
How can I achieve this, using Sed and Grep? Does anyone have a script that they use to do a similar task?