DNS works for ping and nslookup but wget/curl/dig failed always

ChinaMartin

New Member
Joined
Nov 19, 2018
Messages
4
Reaction score
1
Credits
0
Waiting for help, My machine is running Linux Cent OS 7.4, however, i found that DNS works for ping and nslookup but wget/curl/dig failed always. I am sure DNS server is okay.

when issuing commands like wget/curl/dig, there's DNS request for URL, but DNS always failed to response.
ping and nslookup works fine. If i bind static IP with URL, it works fine.

Any clues about this issue ?
 


Lazydog

Member
Joined
Jul 27, 2017
Messages
85
Reaction score
66
Credits
0
Would be nice if you added the output when you use those commands so we can see what you did. DNS is going to work or it's not going to work it doesn't decide which program it is going to work for.
 
OP
ChinaMartin

ChinaMartin

New Member
Joined
Nov 19, 2018
Messages
4
Reaction score
1
Credits
0
Let's do a couple tests - paste the output of these..

dig www.linux.org

nslookup www.linux.org

Hi, Rob,

Sorry for this late reply, I finally figured it out on my own. The truth is that if IPv4 and IPv6 address are configured at the same time, The Linux (Cent os 7)would request A record and AAAA record with same source IP, source Port, destination address and destination port at the same time. Which could trigger a firewall deny in some circumstances, and the Linux would wait A and AAAA response which could never be possible.
upload_2019-1-7_22-24-8.png


That's the real problem.

add the command in /etc/resolv.conf as below.

options single-request-reopen

Nice day, so happy.
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Staff online

Members online


Top