          MODULE=nss-myhostname
         VERSION=0.3
          SOURCE=$MODULE-$VERSION.tar.gz
      SOURCE_URL=http://0pointer.de/lennart/projects/nss-myhostname/
      SOURCE_VFY=sha1:d62b0daffa7d37bb1c94b3aa25c75a97e5cf0d47
        WEB_SITE=http://0pointer.de/lennart/projects/nss-myhostname/
         ENTERED=20110421
         UPDATED=20110908
           SHORT="GNU Name Service Switch"

cat << EOF
nss-myhostname is a plugin for the GNU Name Service Switch (NSS) functionality 
of the GNU C Library (glibc) providing host name resolution for the locally 
configured system hostname as returned by gethostname(2). A lot of software 
relies on that the local host name is resolvable via DNS to an IPv4 or IPv6 
address. When using dynamic hostnames this is usually achieved by patching 
/etc/hosts which however is suboptimal since it requires a writable /etc file 
system and is fragile because the file might also be edited by the 
administrator. nss-myhostname simply returns the IPv4 address 127.0.0.2 
(wich is on the local loopback) and the IPv6 address ::1 
(which is the local host) for whatever system hostname is configured locally. 
Patching /etc/hostname is thus no longer necessary.

printf "${PROBLEM_COLOR}
Note: 

You will need to edit /etc/nsswitch.conf and make this line;

hosts:      files nisplus nis dns

look like this;

hosts:      files nisplus nis dns myhostname

To test, run; getent ahosts `hostname`

and you should see something like this;

192.168.2.107   STREAM sidney.ponspontis.net
192.168.2.107   DGRAM  
192.168.2.107   RAW
${DEFAULT_COLOR}
EOF
