Closed gmkurtzer closed 5 years ago
@gmkurtzer I'm mitigate with a "DNS by default (like 8.8.8.8
)", some users/admins want control that, and some sites doesn't allow DNS requests on arbitrary servers and restrict them to internal DNS. So it may be safer to add a configuration directive like default nameserver
in singularity.conf
and leave it empty by default. Thoughts ?
Well, right now we have a default, and it doesn't work. I would recommend to pull the nameserver
entry from the host's /etc/resolv.conf
or come up with a logical sane.
I tend to agree with @cclerget here in that if you are creating your own network namespace you should probably configure that yourself. But it's hard to know without some use cases.
Do we have any users we can ping who use the --net
feature often and see what they think?
I just dug a bit more, and it seems like /etc/resolv.conf
is being bound into the container from the configuration file (config resolv_conf = yes
), and my version of Ubuntu is doing some Systemd DNS resolution magic (which just makes me cringe) which is not available to the container once we are in a different network namespace.
Upon thinking about it further, and knowing the above, I'm not sure there is a sane default we can use which is better then the current behavior.
A followup feature request might be to parse the resolv.conf
file, look for a localhost address (127.x.x.x
), and provide a warning that this DNS server will not be available from within a different network namespace from the host.
Writing this one off as a Systemd feature.
Version of Singularity:
3.0.2
Expected behavior
The
--net
options (even when given without--dns
option) should properly configure a reasonable default DNS nameserver (like8.8.8.8
rather then127.0.0.53
).Actual behavior
It don't work.
Steps to reproduce behavior