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: '126.96.36.199'
> With dig:
> $ dig www.vpngate.net @188.8.131.52 +short
> $ dig www.vpngate.net @184.108.40.206 +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.