Re: python socket dns query will get the correct result while the dig will not.

2019-10-02 Thread Manfred Lotz
On Wed, 2 Oct 2019 04:27:14 + (UTC) Hongyi Zhao wrote: > Hi, > > See my following test: > > With ipython: > > In [1]: import > socket > > In [2]: socket.gethostbyname > ('www.vpngate.net') > Out[2

Re: python socket dns query will get the correct result while the dig will not.

2019-10-01 Thread Chris Angelico
On Wed, Oct 2, 2019 at 4:41 PM Hongyi Zhao wrote: > > On Wed, 02 Oct 2019 16:28:40 +1000, Chris Angelico wrote: > > > When you ask dig, you are always asking for a DNS lookup. But > > gethostbyname does a lot of other things too. > > What other things, could you please give more detailed hints? S

Re: python socket dns query will get the correct result while the dig will not.

2019-10-01 Thread Hongyi Zhao
On Wed, 02 Oct 2019 16:28:40 +1000, Chris Angelico wrote: > When you ask dig, you are always asking for a DNS lookup. But > gethostbyname does a lot of other things too. What other things, could you please give more detailed hints? > My guess is that your > /etc/hosts has an entry for that doma

Re: python socket dns query will get the correct result while the dig will not.

2019-10-01 Thread Chris Angelico
On Wed, Oct 2, 2019 at 2:31 PM Hongyi Zhao wrote: > > Hi, > > See my following test: > > With ipython: > > In [1]: import > socket > > In [2]: socket.gethostbyname > ('www.vpngate.net') > Out[2]: '130.158.75.44' > > > With dig: > > $ dig www.vpngate.net @114.114.114.114 +short > 31.13.65.1 > $ dig

python socket dns query will get the correct result while the dig will not.

2019-10-01 Thread Hongyi Zhao
Hi, See my following test: With ipython: In [1]: import socket In [2]: socket.gethostbyname ('www.vpngate.net') Out[2]: '130.158.75.44' With dig: $ dig www.vpngate.net @114.114.114.114 +short 31.13.6