[Lunar-commits] <moonbase> nss-myhostname: Adding to moonbase.

Dennis `stumbles` Veatch stumbles at lunar-linux.org
Thu Apr 21 17:19:46 CEST 2011


commit b8c4e7d69d574f41534364fc37803890a059021b
Author: Dennis `stumbles` Veatch <stumbles at lunar-linux.org>
Date:   Thu Apr 21 11:19:46 2011 -0400

    nss-myhostname: Adding to moonbase.
---
 net/nss-myhostname/DETAILS      |   43 +++++++++++++++++++++++++++++++++++++++
 net/nss-myhostname/POST_INSTALL |    4 +++
 2 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/net/nss-myhostname/DETAILS b/net/nss-myhostname/DETAILS
new file mode 100644
index 0000000..ca267aa
--- /dev/null
+++ b/net/nss-myhostname/DETAILS
@@ -0,0 +1,43 @@
+          MODULE=nss-myhostname
+         VERSION=0.2
+          SOURCE=$MODULE-$VERSION.tar.gz
+      SOURCE_URL=http://0pointer.de/lennart/projects/nss-myhostname/
+      SOURCE_VFY=sha1:0bb13e7bb748af6b516106b0e5be31b76611b71d
+        WEB_SITE=http://0pointer.de/lennart/projects/nss-myhostname/
+         ENTERED=20110421
+         UPDATED=20110421
+           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
diff --git a/net/nss-myhostname/POST_INSTALL b/net/nss-myhostname/POST_INSTALL
new file mode 100644
index 0000000..eea8d2f
--- /dev/null
+++ b/net/nss-myhostname/POST_INSTALL
@@ -0,0 +1,4 @@
+printf "${PROBLEM_COLOR} Note: \n You will need to edit /etc/nsswitch.conf and make this line; \n " &&
+printf "hosts:      files nisplus nis dns \n  look like this; \n hosts:      files nisplus nis dns myhostname \n" &&
+printf "To test, run; getent ahosts `hostname` \n and you should see something like this; \n" &&
+printf "192.168.2.107   STREAM sidney.ponspontis.net \n 192.168.2.107   DGRAM  \n 192.168.2.107   RAW${DEFAULT_COLOR} \n"


More information about the Lunar-commits mailing list