From: Stephen L Johnson Date: Wed, 17 Nov 1999 04:09:17 +0000 (+0000) Subject: Initial import X-Git-Tag: start~15 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c3983078ea9510b96a3472eff37f69f98edac76;p=spong.git Initial import --- diff --git a/utils/gethost-test b/utils/gethost-test new file mode 100755 index 0000000..314f04c --- /dev/null +++ b/utils/gethost-test @@ -0,0 +1,31 @@ +#!/usr/bin/perl +# +# gethost-test - This program can be used to test whether you system is setup +# to get it's fully qualified domain name. + +use Sys::Hostname; + +# Get our hostname and try to get fully qualified domain name +$host = &Sys::Hostname::hostname(); +print "\nHost name found to be - $host \n\n"; + +($HOST) = gethostbyname($host); +print "gethostbyname() says my host name is - $HOST \n\n"; + +@parts = split(/\./,$HOST); + +if ( $#parts + 1 >= 3 ) { + print "I have apparently found a fully qualified domain name.\n" . + "\"$HOST\" should be the name given for this host in the\n" . + "spong.hosts configuration file.\n\n"; +} else { + print "I didn't find a fully qualified host name. You will have trouble +getting spong-server to recognize this host. You have couple of options + 1) In your \"/etc/hosts\" file make sure that the first name after your + host's ip address is a fully qualify domain name. + 2) Name sure your host is defined in your DNS servers and make sure that + 'dns' is before 'files' on the 'hosts:' line of your \"/etc/nsswitch\" + file or your OS's equivalent file. You want the resolver to look in + DNS before the \"/etc/hosts\" file.\n\n"; +} +