Coder Social home page Coder Social logo

Comments (16)

opav avatar opav commented on July 28, 2024 3

That snippet works!

It went directly to 8.8.8.8. Confirmed my DNS log has no queries. And also saw the outbound packets going to 8.8.8.8 from my router's tcpdump trace.

from pyfunceble.

opav avatar opav commented on July 28, 2024 2

So I just installed latest PyF-dev and this time x64 Python (https://www.python.org/downloads/windows/) but it is still going to my DNS instead of 8.8.8.8:

pyfunceble 2.13.0.dev (Green Galago: Skitterbug)
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)]

image

image

from pyfunceble.

funilrys avatar funilrys commented on July 28, 2024

Hi @opav,

Sorry for the delay, I had to setup Windows 10 so that I can develop and try to debug from there.

May I ask how do determine that PyFunceble still uses the OS settings ?

Also, thanks for using the dev branch! Feedback from the dev branch helps a lot!

Today (Berlin Time) I made a push to the dev, it includes the logger.
Can you update to the latest version and give me the content of output/logs/debug.log after running the following ?
WARNING if you don't want to expose your DNS IP/Server Name, please anonymize or send the log privately per email or KeyBase (prefered). All issue/debug data shared privately with me will be safely destroyed from my machine and Keybase once the issue is resolved.

> PyFunceble -d google.com --debug --no-whois --dns yourDNSServer 

Thanks again for your feedback.

Cheers,
Nissar

from pyfunceble.

funilrys avatar funilrys commented on July 28, 2024

Hi @opav,

Can you test if the patch I just pushed fixes your issue?

Cheers,
Nissar

from pyfunceble.

opav avatar opav commented on July 28, 2024

Sorry was away, will test it shortly.

from pyfunceble.

opav avatar opav commented on July 28, 2024

Hi @funilrys ,

I install a fresh pyfunceble 2.11.6.dev (Green Galago: Skitterbug) with all defaults and the problem still persist.

I can confirm it is still using my OS DNS (which points to a DNS server on my network), from the queries in my DNS server log.

debug.log

Hope the log helps, thank you.

from pyfunceble.

mitchellkrogza avatar mitchellkrogza commented on July 28, 2024

Tested on Windows 10 @funilrys @opav
PyFunceble 2.13.0.dev

Does indeed use the external DNS server I specified.
This test conducted inside a miniConda environment on Windows 10.

2019-10-01_14-04

2019-10-01_14-07

2019-10-01_14-09

from pyfunceble.

opav avatar opav commented on July 28, 2024

I am on Windows 7 and I noticed the Python version is a bit different from @mitchellkrogza , mine says:

Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)]

from pyfunceble.

funilrys avatar funilrys commented on July 28, 2024

I came to the same conclusion as @mitchellkrogza .... But we are using Windows 10 😞

Can you test the following locally and tell me if there is a difference (from the DNS log)

import dns.resolver

# This is the part we do.
# We don't touch the default resolver, we use a new one.
our_resolver = dns.resolver.Resolver(configure=False)
our_resolver.nameservers = ["8.8.8.8"]

print(our_resolver.query('google.com', 'A').response)

print("*" * 50)

# This is the part we don't do and the possible solution for your case.
# We replace the default resolver. and work with it.
dns.resolver.default_resolver = dns.resolver.Resolver(configure=False)
dns.resolver.default_resolver.nameservers = ['8.8.8.8']

print(dns.resolver.query('google.org', 'A').response)

Cheers,
Nissar

from pyfunceble.

mitchellkrogza avatar mitchellkrogza commented on July 28, 2024

Do you have any DNS servers hard coded in your network settings? With windows that could well be a cause of what you experienced.

2019-10-02_08-34

from pyfunceble.

funilrys avatar funilrys commented on July 28, 2024

@opav which one worked? google.com or google.org ?

from pyfunceble.

opav avatar opav commented on July 28, 2024

Both queries works. Meaning both went direct to 8.8.8.8.

Think we are getting close to the issue.

id 44003                                          
opcode QUERY                                      
rcode NOERROR                                     
flags QR RD RA                                    
;QUESTION                                         
google.com. IN A                                  
;ANSWER                                           
google.com. 142 IN A 172.217.194.113              
google.com. 142 IN A 172.217.194.138              
google.com. 142 IN A 172.217.194.139              
google.com. 142 IN A 172.217.194.100              
google.com. 142 IN A 172.217.194.101              
google.com. 142 IN A 172.217.194.102              
;AUTHORITY                                        
;ADDITIONAL                                       
**************************************************
id 27511                                          
opcode QUERY                                      
rcode NOERROR                                     
flags QR RD RA                                    
;QUESTION                                         
google.org. IN A                                  
;ANSWER                                           
google.org. 300 IN A 216.239.32.27                
;AUTHORITY                                        
;ADDITIONAL 

from pyfunceble.

funilrys avatar funilrys commented on July 28, 2024

@opav What if you run ?

PyFunceble -d github.com --http --dns yourDNSServer --no-whois

from pyfunceble.

opav avatar opav commented on July 28, 2024

This works as expected, went to 8.8.8.8 as specified -
PyFunceble -d github.com --http --dns 8.8.8.8 --no-whois

.....

I also trace thru dns_lookup.py and it seems for the earlier commands, the code is getting results from this, the default OS resolver, instead of my specified --dns server?

req = getaddrinfo(subject, 80, proto=IPPROTO_TCP)

from pyfunceble.

funilrys avatar funilrys commented on July 28, 2024

Nope, our issue is actually coming from :

req = PyFunceble.requests.head(
self.subject,
timeout=PyFunceble.CONFIGURATION.timeout,
headers=self.headers,
verify=PyFunceble.CONFIGURATION.verify_ssl_certificate,
)
else:
# We are not globally testing a URL.
# We get the head of the constructed URL.
req = PyFunceble.requests.head(
self.subject,
timeout=PyFunceble.CONFIGURATION.timeout,
headers=self.headers,
verify=PyFunceble.CONFIGURATION.verify_ssl_certificate,
)

The patch is written but I'm doing some review of the patch itself in order to avoid a big performance loss.

from pyfunceble.

funilrys avatar funilrys commented on July 28, 2024

@opav As the new version was released by the CI tool, can you test and tell us ? https://pypi.org/project/PyFunceble-dev/#files

P.S: Please DO NOT close this issue manually. This issue is going to be closed automatically once 5398233 will be merged to master.

from pyfunceble.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.