Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Another Solution, Problem Resolved' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Another Solution, Problem Resolved
Authored by: ework on Feb 13, '05 11:54:09PM

Ok I worked up a solution for that known issue from before. I found that if I change the domain option in resolv.conf it allows me to do "ping computer.domain". The new script below, when you connect, will comment out your old domain directive and append a new one. When you disconnect it will remove the new domain directive and uncomment the old one. This eliminates the need to copy the file to a temporay location and copy it back when finished.

[ /etc/ppp/ip-up ] (symlink to /etc/ppp/ip-down)

NETMASK=`echo $IPLOCAL | awk -F. '{OFS = "."}{print $1,$2,$3}'`
REVERSE=`echo $IPLOCAL | awk -F. '{OFS = "."}{print $3,$2,$1}'`

if [ `basename $0` = "ip-up" ] ; then
/sbin/route -n add -net $NETMASK $IPREMOTE
cat /etc/resolv.conf | sed s/^domain/#domain/ > /etc/resolv.conf
echo "domain $DOMAIN" >> /etc/resolv.conf
echo "nameserver $DNS1" > /etc/resolver/$DOMAIN
echo "nameserver $DNS2" >> /etc/resolver/$DOMAIN
ln -s $DOMAIN /etc/resolver/$
/sbin/route -n delete -net $NETMASK $IPREMOTE
cat /etc/resolv.conf | grep -v "domain $DOMAIN" > /etc/resolv.conf
cat /etc/resolv.conf | sed s/^#domain/domain/ > /etc/resolv.conf
rm -f /etc/resolver/$DOMAIN
rm -f /etc/resolver/$


[ Reply to This | # ]