python socket dns query will get the correct result while the dig will not.
On Wed, Oct 2, 2019 at 2:31 PM Hongyi Zhao <hongyi.zhao at gmail.com> wrote:
> See my following test:
> With ipython:
> In : import
> In : socket.gethostbyname
> Out: '18.104.22.168'
> With dig:
> $ dig www.vpngate.net @22.214.171.124 +short
> $ dig www.vpngate.net @126.96.36.199 +short
> Any hints?
When you ask dig, you are always asking for a DNS lookup. But
gethostbyname does a lot of other things too. My guess is that your
/etc/hosts has an entry for that domain. It's also possible that your
DNS resolver is misconfigured, especially since the authoritative
servers for that domain disagree with your dig results.