Questions tagged [dig]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
23 views

BASH + dig on list of domains gives wrong input to dig with domains suffixed with '\013' [duplicate]

I have a list of domains, and I want to use dig to check whether those domains have HTTPS records or not. I ran a for loop to do so, and I realized that the reason why I don't have any result is ...
cs.lev's user avatar
  • 1
1 vote
2 answers
108 views

What is the difference between host and domain in dig?

When running dig you can specify a "server" (the DNS server you make query against), "domain" and "host". Since "host" is not optional, I'm guessing this is ...
Andrew Savinykh's user avatar
1 vote
1 answer
117 views

Bind with RPZ acts weirdly if a subdomain is used aside a wildcard

I'm unsure if I found a bug in bind. I've setup a simple dns server on debian 12. in named.conf.options zone "rpz-test" { type master; file "/etc/bind/rpz-test.zone"; ...
user3450548's user avatar
  • 2,920
0 votes
0 answers
23 views

Diagnose and debug bind server configuration lookup with exit line

I'm using dig with dig someserver.com -p 53 @localhost checking if my bind server do what it should. However even if I have a rpz set up with a wildcard like *.com A 127.0.0.1 most of .com replies ...
user3450548's user avatar
  • 2,920
0 votes
1 answer
50 views

Parse results of a "dig" bulk query

We use a security rating service which among other things, searches the world for imposter domains that resemble our domains. So it does find some of those but also finds ones that don't exist. It ...
JetJaguar's user avatar
0 votes
2 answers
730 views

Problems with DNS resolution

i have a problem with DNS resolution. The routing seems to work, because I can ping other servers and traceroute also works. But using dig, i get the a address for 'a.root-servers.net not found error. ...
der-zebastian's user avatar
1 vote
1 answer
310 views

Error redirection fail with bind - dig

I'm trying to test some nameservers against a domain name. For that, I created a script that reads a list of nameservers and asks for a domain name. Something basic like this: #!/bin/bash domain=$1 [ ...
markfree's user avatar
  • 365
2 votes
1 answer
4k views

Using dig to query an address without resolving CNAMEs

I've pored over the man pages and I'm pretty sure the answer is "no" but is there a way to prevent dig from resolving a CNAME record for a host? For example: $ dig +short mail.yahoo.com A ...
miken32's user avatar
  • 466
0 votes
1 answer
109 views

Weird echo output in cygwin

I'm struggling with a really simple Cygwin script, but I can't get my head around it. Hope someone can give me a hand. Here you are the script: h=www.ibm.com for ip in $(dig $h +short); do echo "...
Jesús Ángel's user avatar
2 votes
1 answer
156 views

Getting the same DNS TTL value for all websites

I'm using the dig utility to get the TTL value of websites on local DNS and it always shows the same value of 5s for all websites. What can the reason be? How can I get the original DNS TTL value? Am ...
Vens8's user avatar
  • 23
0 votes
0 answers
986 views

dig a SRV record to host:port format directly?

dig some.domain SRV +short gives me an output like: 1 1 1234 real.location.of.some.host. Is there a way of getting the output directly as real.location.of.some.host:1234, without a couple of cuts or ...
OJFord's user avatar
  • 1,963
1 vote
0 answers
45 views

Is there a streaming endpoint for DNS lookup / IP metadata?

I would like to know all changes of domain names / metadata linked to a given (wide) range of IPs. For now, I execute a batch of scripts that extract regularly the domain name / metadata behind each ...
Olscream's user avatar
1 vote
1 answer
698 views

cannot access github.com

I cannot nslookup github: nslookup github 8.8.8.8 ;; connection timed out; no servers could be reached nslookup github.com ;; connection timed out; no servers could be reached nb: default ns server =...
achille's user avatar
  • 203
3 votes
1 answer
491 views

What is meant by "OS resolver libraries" that are used by the "dig" command?

I know that dig queries the DNS server in the /etc/resolv.conf but I read that the difference between dig and nslookup is that dig uses OS resolver libraries. But what are the OS resolver libraries?
user3737708's user avatar
0 votes
1 answer
1k views

nslookup/dig not appending domain suffix for SRV searches

I am trying to figure out why doing a SRV record search on Ubuntu will not work without specifically including the FQDN on the end of the address. I have the domain name listed in my resolv.conf ...
tczx3's user avatar
  • 1
1 vote
1 answer
467 views

Naked dig cannot reach servers, otherwise resolution works

I installed dig via pacman -S bind and it hangs when started as dig: # dig google.com ; <<>> DiG 9.16.25 <<>> google.com ;; global options: +cmd ;; connection timed out; no ...
WoJ's user avatar
  • 1,545
1 vote
1 answer
86 views

dnsutils points to public IP of client machine, not server

I am logged in via SSH to a remote machine, which is a Raspberry Pi 4. I am trying to use dnsutils to extract the public IP of the remote machine. However, it is returning the public IP of the client ...
Anthony Knighton's user avatar
12 votes
2 answers
4k views

How to install dig on Cygwin?

I cannot find dig command on my Cygwin, nor any package name that would directly point to it. If there is a package containing it, then which one to install?
Vlastimil Burián's user avatar
0 votes
1 answer
146 views

Bash Scripting Output

So my bash scripting is not the best, but the following script takes IP addresses from a text file and feeds the output to a shell and shows only the dns host names that resolve. #!/bin/bash while ...
SilverSurfer's user avatar
0 votes
1 answer
190 views

bash - Script to output domains MX-es using arguments

I am trying to make a bash script that shows me the domains MX-es of one or more domains given as arguments when running it. Example script call: ./domains.sh domain1.com domain-no-mx.com domain2.net ...
Marco's user avatar
  • 1
1 vote
1 answer
1k views

Wha't is the meaning of global option in dig command and how to use them?

dig mt-example.com ; <<>> DiG 9.4.1-P1 <<>> mt-example.com ;; global options: printcmd I wonder what's the global options and what printcmd meaning, I searched in internet ...
user956609's user avatar
0 votes
1 answer
3k views

Find all the IP Addresses behind any dns

I am trying to find all the IP address of DNS . I tried with dig and nslookup but they return IP address which are up and listening . I want to find all the IPs configured with DNS, whether listening ...
SuS's user avatar
  • 39
-2 votes
1 answer
362 views

Passing Dig command in nmap

I have an issue to take the result of the dig command and pass it to nmap command like: for ip in 'dig mydomain.com -t ns +short' do nmap $ip done
bin harry's user avatar
0 votes
2 answers
2k views

bash loop until dig returns

I am trying the following but it doesn't seem to give me my desired outcome, I basically want to run dig until I get a response at which point exit and continue with rest of script. until dig +answer ...
user avatar
1 vote
1 answer
2k views

Can `dig` show me all common record types at once?

Is there a way to have dig request (potentially over several requests) all of the common types of records for a domain at once? dig any domain.com and dig all domain.com seem to be lacking... ...
Qix - MONICA WAS MISTREATED's user avatar
0 votes
1 answer
1k views

Dig connection timed out while Ping and nslookup work fine

Whenever I run the command dig, the connection times out and no servers are reached.Specifying the DNS server to query makes no difference. Nslookup and Ping on the other hand seem to be working just ...
user444927's user avatar
0 votes
1 answer
3k views

Setting up TXT records in dnsmasq does not work

I want to configure some TXT records in my local dnsmasq which runs on a singleboardcomputer and servers DHCP and DNS in my local network. I use it to make my services that I selfhost at home ...
aslmx's user avatar
  • 21
2 votes
1 answer
1k views

`dig -4` returns IPv6 address

Why would dig -4 return an IPv6 address? % dig -v DiG 9.16.5 % % dig -4 @8.8.8.8 TXT o-o.myaddr.l.google.com | grep TXT ; <<>> DiG 9.16.5 <<>> -4 @8.8.8.8 TXT o-o.myaddr.l....
Tom Hale's user avatar
  • 30.5k
1 vote
0 answers
2k views

Debugging slow & timed out DNS queries

Web pages occasionally fail to load or take a very long time; Chrome will say the error is DNS_PROBE_FINISHED_BAD_CONFIG or DNS_PROBE_FINISHED_NXDOMAIN. I have been able to reproduce this on the ...
Seth's user avatar
  • 111
1 vote
1 answer
431 views

Understanding the dig's DNS query: Does dig set non zero value for Z field?

When I was scrutinizing the DNS query sent by the dig, I found something odd from what RFC's state. I don't know the different variants of DNS protocols out there, but from RFC 1035 Z : Reserved ...
m0hithreddy's user avatar
1 vote
1 answer
1k views

How do I write dig output to /etc/hosts file?

I'm a shell beginner and here's an example, I don't know how to implement it. Any help, thanks in advance! Step 1: Get the domain resolution A record via dig. dig @8.8.8.8 liveproduseast.akamaized....
Matthew's user avatar
  • 351
4 votes
2 answers
1k views

Why does dig +trace take seconds to complete?

The sum of the DNS queries for the following dig command take less than 200 ms to complete, but the entire command takes over 4 seconds. Why does dig +trace take so much longer than the sum of the DNS ...
Ruurtjan Pul's user avatar
0 votes
1 answer
2k views

ping can resolve hostname, while dig is unable to resolve the same hostname?

ping can resolve hostname, while dig is unable to resolve the same hostname? I'm experiencing a strange issue, where ping is able to resolve some DNS hostname, while dig cannot. I've tried to dig +...
Shuzheng's user avatar
  • 4,431
2 votes
4 answers
1k views

Read file and print out ip-address to another file

I have big file that holds something like 40000 rows of domain names. I would like to read that file and use dig (or something else) to look up the IP addresses of the domain names in the DNS, and ...
Toube's user avatar
  • 23
2 votes
1 answer
2k views

dnsmasq behaving strangely: dig returns result for dns lookup, yet ping reports "host not found"

Since my router does not resolve hostnames of LAN devices, I setup my server to act as a DNS using DNSMASQ. DNS Server Specs ---------------- OS: Ubuntu Server LAN IP: 192.168.1.4 I have a ...
turf's user avatar
  • 1,441
1 vote
5 answers
5k views

Script to query a list of domains for MX records then query the answers for the IP addresses?

I need to check mail servers' IP addresses from a list of domains to see if they match a certain IP address. Specifically: Build a list of the domains I want to query Dig the MX record(s) of each ...
pooter03's user avatar
  • 113
5 votes
1 answer
935 views

Going all-in on DNSSEC

I have been doing an effort to go full on DNSSEC on my system with the following setup: dnscrypt-proxy installed, up and running on 127.0.0.1 with require_dnssec = true systemd-resolved running, with ...
Bart Van Loon's user avatar
6 votes
3 answers
7k views

Unable to run DNS queries when response is bigger than 512 Bytes and truncated

Situation: Linux machine running in Azure looking for a public domain that returns 112 results the packet response size is 1905 bytes Case 1: interrogating google DNS 8.8.8.8 - it returns un-...
Marin N.'s user avatar
  • 182
2 votes
3 answers
4k views

Extract A record and query time from dig output

I am having the following output when executing a dig command : dig @1.1.1.1 google.com +noall +answer +stats ; <<>> DiG 9.11.4-P1 <<>> @1.1.1.1 google.com +noall +answer +...
Liviu Andrei's user avatar
3 votes
1 answer
1k views

How to get dig without bind

Is there a way of installing dig or nslookup without BIND (preferably without compilation)? BIND is known to be a huge security hole, and all I need is the ability to resolve domain names to their A ...
RJ Higgs's user avatar
0 votes
0 answers
271 views

Can reach local DNS, but remote not

I'm getting nowhere with the following problem: When using my local ISPs DNS server at 192.168.0.1 (for example putting it into /etc/resolv.conf or using it directly with dig google.com @192.168.0.1) ...
manifestor's user avatar
  • 2,473
0 votes
0 answers
43 views

How to query Docker nameservers?

When I try to update my Ubuntu 18.04,I encounter problems Err:13 https://get.docker.com/ubuntu docker InRelease ...
Richard Rublev's user avatar
2 votes
1 answer
10k views

Dig: connection timed out; no servers could be reached. But ping works?

When I try to run the dig command against either my servers IP or nameserver I get an error: root@kali2:/etc# dig q-type=soa @192.168.100.10 ; <<>> DiG 9.11.4-P2-3-Debian <<>&...
Jane's user avatar
  • 21
0 votes
2 answers
570 views

Using grep and logical operators for pattern matching within shell script

Im trying to develop a script that finds a specific pattern in the output of the dig command running against a list of domains. To do this I'm using grep but having difficulty implementing this using ...
PjMpire's user avatar
2 votes
1 answer
2k views

Why does dig utility hang indefinitely even with timeout specified?

I'm using dig utility to find public IP address. The command I used is: dig +short myip.opendns.com @resolver1.opendns.com but I had problem since on some other computers it took so long, so I ...
Dinko Pehar's user avatar
0 votes
1 answer
1k views

Using socat, how to send to and receive from a public DNS server?

In a file called "query.bin" we have stored the data that is transmitted to a public DNS server by the following command. dig +notcp hello.com @8.8.8.8 How can query.bin now be sent to 8.8.8.8 again ...
Ulysses_'s user avatar
3 votes
1 answer
9k views

nslookup: return only IP address

My research indicated nslookup was never really intended for scripted use: use dig instead, which with the +short option produces machine-readable output according to the query parameters. dig +...
gatorback's user avatar
  • 1,384
9 votes
2 answers
7k views

How shall I understand the output of `dig`?

How shall I understand the output of dig? A DNS server stores a database of resource records. Does dig return the resource records in the database of some DNS server? If yes, which DNS server's ...
Tim's user avatar
  • 102k
0 votes
1 answer
807 views

dnsmasq running in namespace can't take queries from within namespace

I've set up a default dnsmasq.conf with essentially no modifications except: listen-address=192.168.42.2 interface=veth1 # Also tried without server=8.8.8.8 And my /etc/hosts looks like this: 127.0....
Torxed's user avatar
  • 3,637
4 votes
2 answers
3k views

resolve my ip with dig returns empty string

When trying to resolve my public IP address I get an ampty string ip=$(dig +short myip.opendns.com @resolver1.opendns.com)
clarkk's user avatar
  • 1,837