On Monday 10 Nov 2003 2:18 am, Greg Meyer wrote:
> I have a laptop that connects to my office e-mail server as an IMAP client.
> Sometimes I am outside the firewall, and in this case, I can connect to the
> server using the server's fqdn.  When I am inside the firewall, I can
> connect to the server by making an entry in my /etc/hosts file for it that
> aliases it's private ip to it's netbios name (it is an Exchange 5.5
> server).  In order to connect, I simply change the servername in kmail
> depending on where I am.
>
> So now my question, is there any way to set up my hosts/resolv.conf/tmdns
> to look for the server in the local network first and if it cannot find it
> to look it up in the DNS so that I don't have to constantly change the
> setup in kmail?
>
> Since the local addressing scheme in place at my company is quite unique I
> would even be open to doing something like having a script called in
> rc.local check to see what the network ip block of the local network is and
> writing out a hosts file that would have an entry for the server if I am on
> the right network, although I have no idea how to actually implement that.

You mean something like:

cp /etc/hosts.base /etc/hosts
if (/sbin/ifconfig eth0 | grep 192.168.7>/dev/null)
then cat /etc/hosts.extra >> /etc/hosts
fi

(test it first, of course)
HTH

-- 
Richard Urwin

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to