I have a wget 'http://xxxx.net/somepage.asp?params@abc' in a bash file.When I run it, four out of five times it says:Resolving xxxx.net (xxxx.net)... failed: No address associated with hostname.wget: unable to resolve host address 'xxxx.net'Thinking that there was a problem with my DNS server, I added a ping -c 2 xxxx.net before wget.  Ping is 100% positively resolved all the time.What could be the cause?  Does wget have its own method of resolving names?  This is on a Raspberry Pi.
wget is unable to resolve host address 80% of the time
networking;dns;wget
Technically they should both use the same way of resolving addresses, however ping is likely not going to try resolving IPv6 addresses at all (AAAA records) and query directly A records as it's an IPv4-only tool (ping6 does IPv6 ICMP requests).A configuration issue I've seen in some load-balancing DNS servers backed by named (the same should apply no mater what backs the dymamic DNS resolver) is that when there is an A record in the load-balancing configuration and nothing for the same name in named, a request for the AAAA record falls back to named which respond with an NXDomain error (no such domain), preventing the resolver from attempting any other requests. One fix is adding an A, TXT or other compatible record for that name so when named catches an AAAA request it will not return an address nor return NXDomain, so the the client will go on and look for an A record.If you have no control over the DNS server, using wget --inet4-only option may help. If that solves your issue you should also tell the domain owner about the DNS issue.