diff --git a/plinth/modules/config/config.py b/plinth/modules/config/config.py index 94d9b17f8..c999f48f3 100644 --- a/plinth/modules/config/config.py +++ b/plinth/modules/config/config.py @@ -234,6 +234,7 @@ def _apply_changes(request, old_status, new_status): def set_hostname(hostname): """Sets machine hostname to hostname""" old_hostname = get_hostname() + old_domainname = get_domainname() # Hostname should be ASCII. If it's unicode but passed our # valid_hostname check, convert to ASCII. @@ -250,7 +251,13 @@ def set_hostname(hostname): old_hostname=old_hostname, new_hostname=hostname) + # Domain name should be ASCII. If it's unicode, convert to ASCII. + domainname = old_domainname + LOGGER.info('Changing domain name to - %s', domainname) + actions.superuser_run('domainname-change', [domainname]) + + def set_domainname(domainname): """Sets machine domain name to domainname""" old_domainname = get_domainname()