mirror of
https://github.com/fosrl/olm.git
synced 2026-05-06 02:37:55 -05:00
[GH-ISSUE #59] Olm in docker does not override DNS #134
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @JobDoesburg on GitHub (Dec 12, 2025).
Original GitHub issue: https://github.com/fosrl/olm/issues/59
Describe the Bug
I run Olm in docker on some of my machines with network_mode host. However, this doesnt properly override DNS
Environment
To Reproduce
Run olm in docker as shown above.
Then try to resolve an internal DNS alias on the host machine.
Expected Behavior
Resolving should work
@JobDoesburg commented on GitHub (Dec 12, 2025):
I do get
but still
What does work is if I specify the internal DNS server directly
But I want the Olm container to override this for the host
@oschwartz10612 commented on GitHub (Dec 12, 2025):
Hi!
Thanks for testing the new functionality!
If you resolve the dns from within the container does it work?
You could try
apk add bind-tools
dig erasmus.nolai.internal
Also, what DNS service is running on the host? Is it resolvconf,
systemd-resolved, or networkmanager?
@JobDoesburg commented on GitHub (Dec 12, 2025):
Im using systemd-resolved...
Surprisingly, from within the container it also doesnt work
@JobDoesburg commented on GitHub (Dec 12, 2025):
Nvm, if I run with
OVERRIDE_DNS=truein the container it does resolve properly.Now I'm struggling how to instruct my host to use the proper resolver by default too
@JobDoesburg commented on GitHub (Dec 12, 2025):
I found a solution. I added a file to
/etc/systemd/network/50-olm.networkon the host containingWould be interesting to document this or give other instructions how to get this to work with olm in a docker container
@oschwartz10612 commented on GitHub (Dec 12, 2025):
Ahh damn I dont know my own software! Ha! Sorry I should have warned you
about override dns. For olm thats off by default.
I assume this has to do with docker isolating the resolve.conf from the
host as well as it not detecting resolved inside of the container
despite being in the host stack. I am not sure due to docker there is a
great universal solution for this one.
I can put some notes in the docs and include this for resolved.
@JobDoesburg commented on GitHub (Dec 12, 2025):
👍 sounds like a solution
I have thought about running the olm container without network mode host, but on a specific docker network shared with another specific container that needed it. But I didnt get that to work. Anyhow, it would be nice to document the recommended use cases for Olm in a docker container, because there are some interesting docker networking quirks about it that you otherwise typically wouldn't come across.
@returntrip commented on GitHub (Feb 2, 2026):
Thank god for this issue :)... the fact that the linux
pangolincli hasoverride-dnsdefaulting to true andolmhas it off by default confused me a LOT. I spent about three hours trying to understand why I could not ping aliases from a machine runningolm. Perhaps it would be best to have same defaults across cli tools?