[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: sendmail gethostbyaddr fails



On Fri, 13 Jul 2001, Mike Pfleger wrote:

> this.  This is what I suspected.  Since I am using dhcp-client on
> this workstation, and a fireplug firewall, what do I need to do to
> /etc/hosts to make it reflect the state of ifconfig (see below)?

/etc/ppp/ip-{up,down}.d/xxx  script

something along the lines of:
# Determine our fqdn from our ISP
addr=$PPP_LOCAL
maxloop=20
cntr=0
name=""
until (test ! -z "$name");  do
   cntr=$(($cntr+1))
   name=$(host $addr | grep '^Name:' | awk '{print $2}')
   test=$(echo $name | cut -d ' ' -f 1)
   if [ "$name" != "**" ]; then
      break
   elif (($cntr > $maxloop)); then
      name=""
      break
      fi
   done
if [ ! -z "$name" ]; then
	line=$addr$'\t\t'$name" <desired alias name>";
else
	line=$addr$'\t\t'"  <desired alias name>";
	fi;
echo $line | cat /etc/networking/hosts  - > /etc/hosts

PS - no I've not forgotten that I owe you a responce... got a sick puppy
(no, the dog, me being sick is nothing new)... things're hectic.

-- 
Rick Nelson
Intel engineering seem to have misheard Intel marketing strategy. The phrase
was "Divide and conquer" not "Divide and cock up"
(By iialan@www.linux.org.uk, Alan Cox)



Reply to: