[Docker] silverbullet resolves to the IP of silverbullet.dev

This one had me laughing out loud. I have feelings about whoever decided this feature was a cool and good thing to have, and I like to imagine they hold a particular grudge against people who use Docker. :joy:

First of all, disclosure: I’m actually using podman (5.5.0 on Rocky Linux). That aside, when setting up Caddy to reverse-proxy silverbullet, I set it to reverse-proxy silverbullet:9002 (I’ve set the port to that for reasons that are mysterious and unfathomable (idrk why, lol)).

However, because of some… interesting OS feature, it seems that instead of my local container named silverbullet, silverbullet instead is resolved to the IP of the (old?) silverbullet.dev site. (ping silverbullet executed on the host system exhibits the same behavior.)

This is my plea for aid in ridding my server of… whatever that feature is. /laughing

Okay. I think I figured it out. Might be worth keeping this for posterity because I think it’s hilarious and not intuitive at all to figure out why it happens and how to debug it.

So… because the hostname of my machine is monospacedmagic.dev, during the installation, the RHEL-based Rocky Linux added search dev to /etc/resolv.conf as the first line… This will try to resolve hostnames by first checking if ā€œ$name.devā€ resolves, and then letting other resolvers try… :joy:

So, the solution is: Disable NetworkManager’s DNS management, then edit /etc/resolv.conf and delete the line that looks like search tld. Then reboot your server. Now your container hostnames should resolve properly. :slight_smile:

Or, even better: Ignore Red Hat’s advice (they advise you set your machine’s hostname to a fully qualified domain name) and set your machine’s hostname to something that does not include a dot. :sweat_smile: Though this is best done before installing the OS.