LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   dns: request all host records? (https://www.linuxquestions.org/questions/linux-networking-3/dns-request-all-host-records-4175490468/)

stateless 01-07-2014 05:20 PM

dns: request all host records?
 
Can dig (or some other tool) ask a dns server to give you all A/AAAA records for a zone? Seems like that would be rather handy, but somehow missing it in the manual pages...

catkin 01-08-2014 03:06 AM

Code:

dig @server_ID <name of zone file>
In case a TSIG is required, use -k <path of file containing the TSIG key>

IDK about other validating mechanisms apart from TSIG.

EIDT: that gives the entire zone file; you could post-process the output to get only the record types you want.

rhoekstra 01-08-2014 03:25 AM

Code:

dig @host zone
does only answer the host entries for the specified zone. (in my case, the zone file equales the zone name, so I can't vouch for situation where that would be different.

Code:

dig axfr @host zone
would do a zone transfer though if settings allow (!!), so you can parse indeed as catkin mentions. you'd have to grep for A and AAAA fields.


All times are GMT -5. The time now is 01:11 PM.