GithubHelp home page GithubHelp logo

Comments (4)

yzguy avatar yzguy commented on June 12, 2024

Interesting.

If you do this below and see if it resolves.

>>> import dns.resolver
>>> dns.resolver.resolve('localhost')[0].address
'127.0.0.1'

from octodns-bind.

ross avatar ross commented on June 12, 2024
>>> import dns.resolver
>>> dns.resolver.resolve('localhost')[0].address
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/ross/octodns/octodns-bind/env/lib/python3.10/site-packages/dns/resolver.py", line 1368, in resolve
    return get_default_resolver().resolve(
  File "/Users/ross/octodns/octodns-bind/env/lib/python3.10/site-packages/dns/resolver.py", line 1190, in resolve
    (request, answer) = resolution.next_request()
  File "/Users/ross/octodns/octodns-bind/env/lib/python3.10/site-packages/dns/resolver.py", line 691, in next_request
    raise NXDOMAIN(qnames=self.qnames_to_try, responses=self.nxdomain_responses)
dns.resolver.NXDOMAIN: The DNS query name does not exist: localhost.

from octodns-bind.

ross avatar ross commented on June 12, 2024

Fix over in #25

from octodns-bind.

yzguy avatar yzguy commented on June 12, 2024

Oh this probably happens because dns.resolver does actually query a resolver immediately and doesn't go through the normal chain of things (host file, etc.) before making it. So in some cases you have like systemd-resolved dealing with that or whatever resolver may be running locally on the machine and then going to a real resolver, but if your resolver is 1.1.1.1 or something and it queries it, you won't get anything.

Interesting, may need to change that so it does the actual looking into host file, etc or just handle the localhost -> 127.0.0.1 in the code (which I don't love). Probably need to use socket.gethostbyname

from octodns-bind.

Related Issues (12)

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.