-
Notifications
You must be signed in to change notification settings - Fork 588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
private-etc=resolv.conf will not update for changed DNS server #3649
Comments
Instead of coping, we could bind-mount all the file.
Sending all the DNS-query of everybody to clownflare. bad idea. What we could do is setting it 127.0.0.1 (or what ever) and have a simple dns-forwarder there. Such as dnsmasq. Or we can use fdns, but not everyone want this. |
According to the manpage, bind-mounts only work as root, so that's unfortunately not a solution most of the time
Indeed. And running an additional local service is probably not a great option either. This is a bit tricky. |
The This should work I think (will test later):
|
Just tested it, it doesn't. Also, |
In general are changes from system to sandbox propagated. However if resolv.conf is a file (not a symlink) it can be edited (which will work) or replaced (which does not work) by the controlling program. This means bind-mounting doesn't help either. |
@haarp Combining
But as @rusty-snake says, this only works if |
isn't it still a way to somehow fix/workaround that (in case of NetworkManager)? |
If NM operates in rc-manager=symlink mode and |
Well, actually, it is symlink to BTW, |
Hello,
I have witnessed this problem with Discord, but I believe it to be a generic issue.
With
private-etc=resolv.conf
, the jail will receive a copy of the system's resolv.conf. If the system is now moved to a different location/network with a different DNS server, the system's resolv.conf will be updated to use the new server, but the jail's resolv.conf will not. DNS requests will henceforth fail in the jail as they try to use an unreachable server.Ideally the jail's resolv.conf should be kept in sync with the system's, but this might require special handling of this file.
Alternatively, the DNS server in the jail's resolv.conf could be set to a globally reachable one instead of the local network's one, such as 1.1.1.1, with
dns=1.1.1.1
. But this unlikely to be in everyone's interest.Reproduce
firejail --noprofile --private-etc=resolv.conf bash -c 'while true; do cat /etc/resolv.conf; getent hosts google.com; sleep 5; done'
Environment
Gentoo Linux, firejail-0.9.62-r1
Thanks!
The text was updated successfully, but these errors were encountered: