Skip to content

Instantly share code, notes, and snippets.

@petasittek
Last active July 1, 2023 01:24
Show Gist options
  • Save petasittek/1378951 to your computer and use it in GitHub Desktop.
Save petasittek/1378951 to your computer and use it in GitHub Desktop.
Find all subdomains of given domain with dig
# let's dig the server
dig example.com
# from the DNS answer we are interested in the authority section
#;; AUTHORITY SECTION:
#example.com. 79275 IN NS a.iana-servers.net.
#example.com. 79275 IN NS b.iana-servers.net.
# now we find out all subdomains
dig @a.iana-servers.net example.com axfr
# in this example we get "Transfer failed." but some NS could return something like
#dev.example.com. 1800 IN A 1.2.3.4
#dev2.example.com. 1800 IN A 5.6.7.8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment