dig performs DNS lookups and displays records matching the specified IP address or domain name.
Questions tagged [dig]
213 questions
276
votes
8 answers
How do I get a list of all subdomains of a domain?
I want to find out all the subdomains of a given domain. I found a hint which tells me to dig the authoritative Nameserver with the following option:
dig @ns1.foo.example example.com axfr
But this never works. Has anyone a better idea/approach

cgicgi
- 2,879
- 2
- 18
- 5
74
votes
2 answers
Using dig to search for SPF records
I am using dig installed on my machine to search for SPF records for a particular domain. Is there a way to search a particular DNS server for the SPF records?
For example, will the following work?
dig domain.example txt host…

bjtilley
- 1,953
- 3
- 17
- 22
66
votes
3 answers
Get IPv4 and IPv6 with one command
I would like to know if it's possible to get IPv4 and IPv6 addresses with just one invocation of dig?
For example, this gives the IPv4 address:
dig hostname A
And this command will give me the IPv6 address:
dig hostname AAAA
How can I get both…

user3645265
- 703
- 1
- 6
- 11
54
votes
2 answers
What does the authority section mean in dig results?
Yesterday I changed my domain's name server from cloudflare to dnspod. And I used dig to test it. But the ANSWER SECTION is always the old name servers.
;; AUTHORITY SECTION:
amazingjxq.com. 21336 IN NS …

amazingjxq
- 4,487
- 7
- 33
- 35
42
votes
1 answer
Meaning of the five fields of the ANSWER SECTION in dig query
Here is the ANSWER SECTION when I run dig www.google.com:
;; ANSWER SECTION:
www.google.com. 108 IN A 74.125.239.115
www.google.com. 108 IN A 74.125.239.114
www.google.com. 108 IN A …

user3051464
- 423
- 1
- 4
- 4
32
votes
1 answer
Find all domains under a TLD
I'm trying to find a way to list all registered domains under a top-level domain (TLD). I.e. everything under .com, .net, etc. All the tools I find only applies to finding subdomains under a domain.

Alex
- 487
- 1
- 5
- 10
26
votes
7 answers
Safely assign value to nested hash using Hash#dig or Lonely operator(&.)
h = {
data: {
user: {
value: "John Doe"
}
}
}
To assign value to the nested hash, we can use
h[:data][:user][:value] = "Bob"
However if any part in the middle is missing, it will cause error.
Something like
h.dig(:data, :user,…

sbs
- 4,102
- 5
- 40
- 54
25
votes
3 answers
dig (DNS Lookup) specify DNS server on Windows
In Linux, I would use dig to specify a DNS server of 127.0.0.1 with the following command:
dig google.com @127.0.0.1
I installed Bind tools for windows (choco install bind-toolsonly). How can I run that same command? I get the following error:
PS…

jhilden
- 12,207
- 5
- 53
- 76
24
votes
3 answers
Using the dig command in python
Just a forewarning, my python skills are almost nonexistent, but I’m trying to learn as I go.
I'm doing a few changes via our DNS control panel over the weekend to about 58 CNAMES (just changing the destination)
And rather than checking the changes…

Christopher Long
- 854
- 4
- 11
- 21
15
votes
2 answers
Dig +trace does not do a trace
dig +trace google.com
; <<>> DiG 9.10.6 <<>> +trace google.com
;; global options: +cmd
;; Received 12 bytes from 100.98.0.0#53(100.98.0.0) in 388 ms
dig google.com +trace
; <<>> DiG 9.10.6 <<>> google.com +trace
;; global options: +cmd
;; Received…

Calicoder
- 1,322
- 1
- 19
- 37
15
votes
3 answers
search for ALL DNS TXT records of a domain and subdomains
There is a way to retrieve ALL (TXT) entries about DNS records of a domain (and subdomains) ?
My goal is to verify the configuration of my domain: www.rosposhop.com
where I correctly set multiple SPF and DKIM records for some…

Giorgio Robino
- 2,148
- 6
- 38
- 59
14
votes
1 answer
Difficulty using Python's socket.gethostbyaddr()
I am trying to reverse dns a list of IPs using socket.gethostbyaddr() in python, which returns 'Unknown Host' for some values, but using dig for the same ip returns the Hostname. Also, dig seems to be significantly faster than using python module,…

bilkulbekar
- 327
- 2
- 3
- 10
14
votes
2 answers
Why dig does not resolve K8s service by dns name while nslookup has no problems with it?
Here are steps to reproduce:
minikube start
kubectl run nginx --image=nginx
kubectl expose deployment nginx --port=80 --type=ClusterIP
kubectl run -i --tty --rm alpine --image=alpine --restart=Never -- sh
apk add --no-cache bind-tools
Now let's…

Kirill
- 6,762
- 4
- 51
- 81
14
votes
2 answers
Can I lookup NS and A at the same time using dig
Is it possible to lookup the A (ip address) and NS (nameservers) of a domain using a single dig command?
I can use dig google.com A +short or dig google.com NS +short but surely it's possible to do it with just one command? If not, is there a…

Stevie
- 245
- 4
- 9
11
votes
1 answer
How make dns queries in dns-python as dig (with additional records section)?
I trying use dns python and want get all records with ANY type query:
import dns.name
import dns.message
import dns.query
domain = 'google.com'
name_server = '8.8.8.8'
domain = dns.name.from_text(domain)
if not domain.is_absolute():
domain =…

tbicr
- 24,790
- 12
- 81
- 106