Skip to content

Editing/Removing domainname doesn't work

Created by: fonfon

Entering a domainname (in sys - 'Configure') works, but I then cannot remove or edit it anymore. I do this by submitting the form with the changed or empty input field 'Domain Name'.

It seems like socket.getfqdn() does not read /etc/hosts but tries to resolve via DNS which doesn't work in my case with VM and a domain that doesn't exist. (see also https://bugs.python.org/issue5004). So when changing the domain name there is often a mismatch between the domain in /etc/hosts and the domain displayed in Plinth. (And the future name services module which contains accurate information.)

Content of /etc/hosts after inserting a hostname that does not exist:

127.0.0.1       localhost
127.0.1.1       freedombox.box.doesnotexist.at freedombox

Content of /etc/hosts after trying to remove the hostname:

127.0.0.1       localhost
127.0.1.1       freedombox. freedombox

At this stage, Plinth still displays box.doesnotexist.at. Also, if I change it via the form to box.nodomain.at, Plinth updates /etc/hosts but still displays box.doesnotexist.at.