From 54789ed499354772969d55ed2ca06a5776fe5b7a Mon Sep 17 00:00:00 2001 From: Stephen L Johnson Date: Wed, 17 Nov 1999 04:09:17 +0000 Subject: [PATCH] Initial revision --- utils/gethost-test | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 utils/gethost-test 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"; +} + -- 2.30.2