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

Manfred Lotz ml_news at posteo.de
Wed Oct 2 03:17:18 EDT 2019


On Wed, 2 Oct 2019 04:27:14 +0000 (UTC)
Hongyi Zhao <hongyi.zhao at gmail.com> 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'
> 

I get '130.158.75.39' which is ok.


> 
> With dig:
> 
> $ dig www.vpngate.net @114.114.114.114 +short

This gives here:

130.158.75.48
130.158.75.42
130.158.75.35
130.158.75.36
130.158.75.44
130.158.75.40
130.158.75.39
130.158.75.38


-- 
Manfred







More information about the Python-list mailing list