Features/nssmyhostname

From FedoraProject

< Features(Difference between revisions)
Jump to: navigation, search
(Created page with ' = nss-myhostname by default = == Summary == Enable nss-myhostname by default on all installations == Owner == * Name: Lennart Poettering * Email: lennart AT...')
 
Line 1: Line 1:
 
 
= nss-myhostname by default =
 
= nss-myhostname by default =
  
Line 15: Line 14:
  
 
== Detailed Description ==
 
== Detailed Description ==
Currently if the local host name is changed /etc/hosts needs to be patched too to ensure it always stays resolvable. In order to simplify read-only root directories and clean things up, we'll enable nss-myhostname by default. This NSS module ensures that the local hostname always stays resolvable. If any local IP addresses are configured it will map the hostname to them. If none are configured 127.0.0.2 resp. ::1 are mapped to it. (127.0.0.2 instead of 127.0.0.1 is used to ensure that the IP address maps forth AND back. On IPv4 127.0.0.2 is mostly equivalent to 127.0.0.1)
+
Currently if the local host name is changed /etc/hosts needs to be patched too to ensure it always stays resolvable. In order to simplify read-only root directories and to clean things up, we'll enable nss-myhostname by default. This NSS module ensures that the local hostname always stays resolvable. If any local IP addresses are configured nss-myhostname will map the hostname to them. If none are configured 127.0.0.2 resp. ::1 are mapped to it. (127.0.0.2 instead of 127.0.0.1 is used to ensure that the IP address maps forth AND back. On IPv4 127.0.0.2 is mostly equivalent to 127.0.0.1)
  
nss-myhostname is configured only as fallback, DNS data, or /etc/hosts always takes precedence
+
nss-myhostname is configured only as fallback; DNS data, or /etc/hosts always take precedence
  
 
== Benefit to Fedora ==
 
== Benefit to Fedora ==
Line 24: Line 23:
 
GNOME3 will include a hostname changing UI which makes changeable hostnames more accessible to the user
 
GNOME3 will include a hostname changing UI which makes changeable hostnames more accessible to the user
  
/etc/hosts does not have to include host-specific information anymore, and can stay read-only, thus simplifying use in stateless setups.
+
/etc/hosts does not have to include host-specific information any more, and can stay read-only, thus simplifying use in stateless setups.
  
 
It's a bit nicer that the local hostname resolves to locally configured IP addresses instead of 127.0.0.1.
 
It's a bit nicer that the local hostname resolves to locally configured IP addresses instead of 127.0.0.1.

Revision as of 19:50, 16 May 2011

Contents

nss-myhostname by default

Summary

Enable nss-myhostname by default on all installations

Owner

Current status

  • Targeted release: Fedora 16
  • Last updated: 2011-05-16
  • Percentage of completion: 50%

Detailed Description

Currently if the local host name is changed /etc/hosts needs to be patched too to ensure it always stays resolvable. In order to simplify read-only root directories and to clean things up, we'll enable nss-myhostname by default. This NSS module ensures that the local hostname always stays resolvable. If any local IP addresses are configured nss-myhostname will map the hostname to them. If none are configured 127.0.0.2 resp. ::1 are mapped to it. (127.0.0.2 instead of 127.0.0.1 is used to ensure that the IP address maps forth AND back. On IPv4 127.0.0.2 is mostly equivalent to 127.0.0.1)

nss-myhostname is configured only as fallback; DNS data, or /etc/hosts always take precedence

Benefit to Fedora

Even if the hostname dynamically changes (e.g. DHCP) it is guaranteed to stay resolvable, to appease tools like "sudo" which require this.

GNOME3 will include a hostname changing UI which makes changeable hostnames more accessible to the user

/etc/hosts does not have to include host-specific information any more, and can stay read-only, thus simplifying use in stateless setups.

It's a bit nicer that the local hostname resolves to locally configured IP addresses instead of 127.0.0.1.

Scope

nss-myhostname is already in the distro. We now plan to enable it by default by pulling it in by the systemd package (which also includes systemd-hostnamed, a tiny bus service used by the GNOME3 hostname changing UI).

Anaconda and NetworkManager no longer need to write /etc/hosts, so they should drop the respective code.

How To Test

Check that sudo works in the weirdest setups still.

Try to resolve the local hostname and the local IPv4 and IPv6 addresses via "getent hosts", "getent ahosts", "getent ahostsv4" and "getent ahostsv6".

use the new GNOME3 hostname UI and play around with it, and ensure the hostname always stays resolvable.

Try all this with and without network connectivity.

User Experience

If users change the hostname things should just work.

Dependencies

anaconda and NM should drop the code that writes to /etc/hosts.

Contingency Plan

Disable the module again, go back to editing /etc/hosts.

Documentation

http://0pointer.de/lennart/projects/nss-myhostname/

Release Notes

  • A note should be added pointing out that /etc/hosts is now static and identical on all machines.

Comments and Discussion