I have cached the response received from dig command using a c code , and I want to use authorities list to call directly for finding the ip ,avoiding a part of dns lookup , but I have no idea how to do that.
;; AUTHORITY SECTION:
gogole.com. 172748 IN NS ns2.google.com.
gogole.com. 172748 IN NS ns3.google.com.
gogole.com. 172748 IN NS ns1.google.com.
gogole.com. 172748 IN NS ns4.google.com.
;; ADDITIONAL SECTION:
ns2.google.com. 104506 IN A 216.239.34.10
ns1.google.com. 345589 IN A 216.239.32.10
ns3.google.com. 104506 IN A 216.239.36.10
ns4.google.com. 104506 IN A 216.239.38.10
For example this is for google , I want to interrogate ns1.google.com next time to have the ip. Can anyone help me ? Thanks.
the Linux
digcommand's syntax is described in its manual pageThis will tell you that:
So, once you have the authoritative name server's name or IP address you want to query, e.g. ns1.google.com as shown in your example, you just add
@ns1.google.comto your dig command-line to obtain the response from that server.for instance, like this:
This is useful to check the TTL set by the owner of the zone for that DNS record, and to troubleshoot DNS cache problems.