Some ways DNS can break

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • SonarLint - Deliver Cleaner and Safer Code - Right in Your IDE of Choice!
  • Scout APM - Less time debugging, more time building
  • SaaSHub - Software Alternatives and Reviews
  • node

    Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:

    One recent frustration I ran into with Node's DNS is that it doesn't seem to resolve whatever.localhost to 127.0.0.1, unlike my browser.

    Not entirely sure which is doing the right thing by the spec here, but I much prefer the browser behavior, because I would really like to not have to add a hosts entry for everything I reverse proxy from Caddy for doing local HTTPS/HTTP2 development, for production parity.

    Oh, and I also found out that Node also isn't able to use the system-wide certs store (which local HTTPS in Caddy adds to) [1], so in the end even adding a hosts entry didn't work, and I had to revert to plaintext HTTP1. Deno is looking more attractive every day [2].

    Really curious to hear how other folks are doing local HTTPS/HTTP2 setups in node these days.

    [1] https://github.com/nodejs/node/issues/3159

    [2] https://github.com/denoland/deno/pull/11491

  • deno

    A modern runtime for JavaScript and TypeScript.

    One recent frustration I ran into with Node's DNS is that it doesn't seem to resolve whatever.localhost to 127.0.0.1, unlike my browser.

    Not entirely sure which is doing the right thing by the spec here, but I much prefer the browser behavior, because I would really like to not have to add a hosts entry for everything I reverse proxy from Caddy for doing local HTTPS/HTTP2 development, for production parity.

    Oh, and I also found out that Node also isn't able to use the system-wide certs store (which local HTTPS in Caddy adds to) [1], so in the end even adding a hosts entry didn't work, and I had to revert to plaintext HTTP1. Deno is looking more attractive every day [2].

    Really curious to hear how other folks are doing local HTTPS/HTTP2 setups in node these days.

    [1] https://github.com/nodejs/node/issues/3159

    [2] https://github.com/denoland/deno/pull/11491

  • SonarLint

    Deliver Cleaner and Safer Code - Right in Your IDE of Choice!. SonarLint is a free and open source IDE extension that identifies and catches bugs and vulnerabilities as you code, directly in the IDE. Install from your favorite IDE marketplace today.

  • distributions

    NodeSource Node.js Binary Distributions

    > Curious how you set that up?

    Via a DNS server we run, that then answers for local things or forwards requests on to the real world.

    To do that locally, set up a DNS forwarder like dnsmasq [0] or unbound [1] (or coredns/bind/etc) to respond for the domain you want to wildcard to localhost. Point your OS DNS settings to 127.0.0.1, then configure the forwarder with your regular external DNS servers.

    The equivalent to `NODE_USE_SYSTEM_CERTS` is a build time option unfortunately. I know the rhel/debian packages do integrate their builds with the system CA's but those packages tend to be ancient. Maybe try the nodesource [2] packaged node.js? The homebrew node formulae [3] looks like it integrates with the brew openssl CA's.

    [0] https://stackoverflow.com/a/22551303

    [1] https://unbound.docs.nlnetlabs.nl/en/latest/manpages/unbound...

    [2] https://github.com/nodesource/distributions

    [3] https://github.com/Homebrew/homebrew-core/blob/c2579d98415bd...

  • homebrew-core

    🍻 Default formulae for the missing package manager for macOS (or Linux)

    > Curious how you set that up?

    Via a DNS server we run, that then answers for local things or forwards requests on to the real world.

    To do that locally, set up a DNS forwarder like dnsmasq [0] or unbound [1] (or coredns/bind/etc) to respond for the domain you want to wildcard to localhost. Point your OS DNS settings to 127.0.0.1, then configure the forwarder with your regular external DNS servers.

    The equivalent to `NODE_USE_SYSTEM_CERTS` is a build time option unfortunately. I know the rhel/debian packages do integrate their builds with the system CA's but those packages tend to be ancient. Maybe try the nodesource [2] packaged node.js? The homebrew node formulae [3] looks like it integrates with the brew openssl CA's.

    [0] https://stackoverflow.com/a/22551303

    [1] https://unbound.docs.nlnetlabs.nl/en/latest/manpages/unbound...

    [2] https://github.com/nodesource/distributions

    [3] https://github.com/Homebrew/homebrew-core/blob/c2579d98415bd...

  • systemd

    The systemd System and Service Manager

    problem: systemd-resolved fails randomly: https://github.com/systemd/systemd/issues/19118

    - this happened to me on two arch linux installations for different domains - I was unable to debug this - would love to somehow get this fixed but I switched to dnsmasq that works fine for me.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts