By default, DNS uses UDP on port 53 to serve requests. When the size of the request, or the response, exceeds the single packet size of 512 bytes, the query is re-sent using TCP. Multiple records responses, IPv6 responses, big TXT records, DNSSEC responses, and zone transfers are some examples of these requests.
Note: When DNS is running on TCP, it is worth checking if is enabled.
Banner Grabbing
DNS does not provide an information banner per se but BIND DNS exposes its version by default.
Note: The version.bind directive is stored under the options section in the /etc/named.conf configuration file.
DNS reconnaissance is an extremely useful tool during the information gathering stage as it can provide valuable insights into the domain and infrastructure. However, it can also uncover new attack vectors, such as when Virtual Routing is enabled.
One method of DNS reconnaissance is through a zone transfer, which involves a Master DNS server copying a zone to another DNS server, typically a Slave server. Although these transfers are ideally restricted to specific IPs, misconfigured servers sometimes allow anyone to request them.
dig
dig axfr @10.0.0.3 domain
Parameters
axfr: initiate an AXFR zone transfer query.
@10.0.0.3: name or IP of the server to query.
domain: name of the resource record that is to be looked up.
Note: It is worth trying to initiate a zone transfer without a domain.