Could someone help me if there exists some way how to get from dig only hostnames if I want to get list of DNS zone? I work with this command:
dig @dns.example.com example.com axfr
output is:
example1.com. 1200 IN A 1.1.1.1
example2.com. 1200 IN A 2.2.2.2
....
I would like to get only
example1.com
example2.com
....
I tried to use filters dig .... | cut -d ' ' -f1
, but it doesn't work correctly in this case. Maybe I should use some regex?