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

Re: resolve.conf specification



I avoid the problem of a separate /etc/resolv.conf for each of my ISP's 
by never using my ISP's DNS servers.
I found that DNS lookups to my local ISP took as long as lookups to the
the main internet DNS servers A through M, about 4 seconds.
So, I run a local DNS server, and I have but one entry 
in my /etc/resolv.conf,
    nameserver      192.168.1.1
If you have but one local computer, you could use the default
    nameserver      127.0.0.1
Again, in this file, I have no ISP nameservers. 
This neatly solves the problem with ISP nameservers,
but you need local DNS with more than just caching.
For DNS,  the debian package "bind" installed /var/named/named.root,
which includes the internet's main DNS servers A through M.
While the documentation on using the "bind" package was not clear,
intuition takes you a long way [I spent about 10 hours mulling
over what to do with DNS; I would like to see more suggestions in
README.debian files with each package, perhaps what the package
maintainer does with it].

I use the debian ppp package version 2.3.6-2, so rather 
than make my own ip-up file, I put files (without a decimal,
eg, ignored are the files up-mail.old) in /etc/ppp/ip-up.d.
Actually, I have but one file there, the further below file
/etc/ppp/ip-up.d/dns-mail-news-time_jameson .
For me, depending on my ISP, this file mostly handles differences
for mail-user-agents and mail-transfer-agents.

>From this "dns-mail-news-time_jameson" file, 
you can infer how you could alter /etc/resolv.conf 
according to your current ISP.
Following somebody else's lead, since I run a local DNS server,
I have two separate files
   /var/named/named.root.real
   /var/named/named.root.fake
according as I have a ppp connection or 
as I do not have a ppp connection.






#!/bin/bash
# BEGINNING OF /etc/ppp/ip-up.d/dns-mail-news-time_jameson .
# Some first line like the above is obligatory for run-parts.
# This files controlling program, /etc/ip-up, sets the following 
# alpha-numberic variables,
#	PPP_IFACE
#	PPP_TTY
#	PPP_SPEED
#	PPP_LOCAL	#LOCAL IP ADDRESS, NEEDED FOR DYNAMIC PPP
#	PPP_REMOTE
#	PPP_IPPARAM
#
# Here, I copy needed configuration files depending on my ISP mnsinc.com
# or pressroom.com.  
#
# You probably also want to 
# "cp /etc/resolv.conf.connected /etc/resolv.conf here; 
# I think not anymore, though maybe copy some named configuration files\
# when go down.
# "knews" will not over-ride the environment variable NNTP, 
# but has news.mnsinc.com in /usr/X11R6/lib/X11/app-defaults/Knews.
#
# For testing,
echo $PPP_IFACE $PPP_TTY $PPP_SPEED $PPP_LOCAL $PPP_REMOTE \
                                >/tmp/ip-up.d.dns-mail.out

case "$PPP_REMOTE" in
          206.239*|206.55*)
		###This is my ISP mnsinc.com.
		##/bin/cp /etc/named.conf.mnsinc-version              \
		#     /etc/named.conf		#used by "named" DNS; \
		#                   I no longer use forwarders though
		##/bin/cp /var/named/boot.options.mnsinc-version      \
		#    /var/named/boot.options	#used by "named" DNS; \
		#                   I no longer use forwarders though
	#
		/bin/ln -fs  /etc/mailname.mnsinc-version  \
	           /etc/mailname #used by pine for outgoing addresses.
		/bin/ln -fs /etc/smail/config.mnsinc-version \
		           /etc/smail/config	#for outgoing mail
		/bin/ln -fs /etc/nmh/mts.conf.mnsinc-version         \
		    /etc/nmh/mts.conf	#for mh MUAs to give correct \
                    #"SENDER:jameson@mnsinc.com" and possibly "From:".
		/bin/ln -fs /etc/news/server.mnsinc-version     \
	        /etc/news/server	#News server, probably only \
                #referenced via my bash, though post-installed by knews.
   		# logger "working with mnsinc.com"    \
		          #used for debugging this script.
               ;;
          198.69.131*)
		###This is my ISP pressroom.com.
		##/bin/cp /etc/named.conf.pressroom-version   \
		##    /etc/named.conf     #used by "named" DNS; \
		##         I no longer use forwarders though.
		##/bin/cp /var/named/boot.options.pressroom-version  \
		##    /var/named/boot.options	#used by "named" DNS;\
		##    I no longer use forwarders though.
		#
		/bin/ln -fs  /etc/mailname.pressroom-version        \
		    /etc/mailname  #used by pine for outgoing addresses.
		/bin/ln -fs /etc/smail/config.pressroom-version	    \
		    /etc/smail/config	#for outgoing mail
		/bin/ln -fs /etc/nmh/mts.conf.pressroom-version	    \
		    /etc/nmh/mts.conf	#for mh MUAs giving correct \
		     #"SENDER:jameson@mnsinc.com" and possibly "From:".
		/bin/ln -fs /etc/news/server.pressroom-version	    \
		   /etc/news/server  #News server, probably only    \
		   #referenced via my bash, though post-installed   \
		   #by knews.
   		# logger "working with pressroom.com" 		\
		                  #used for debugging this script.
		;;
        *)
		logger '/etc/ppp/ip-up:  Oh no!  Can not recognize \
		     the IP address of the now connected ISP provider.'
		;;
esac              

# IP-MASQUERADING:
# re-run the following, which clears and resets ip-masquerading,
# using the new PPP_LOCAL (local ppp interface's ip address).
/etc/rc.boot/ipmasq

# DNS (IP) LOOKUP DAEMON:
/bin/ln -fs   /var/named/named.root.real   /var/named/named.root
# The following starts named from bind package for DNS.
# You can check that "named" works well by the speed of "nslookup ...".
#/usr/sbin/named
/usr/sbin/ndc restart

# MAIL OUTGOING:
/usr/bin/runq   #Send pending mail.
 
# TIME SETTING:
# According to the man pages, the following ntpdate will have no effect 
# if the daemon xntpd already runs;
# so I shouldn't run xntpd at startup from /etc/init.d/xntp3.
# When I ran under UTC, if I ran Microsoft NT, the time was off by 5 
# hours [England - East Coast time];
# when I booted into Linux, the time was off by 1 hour 
# [this was probably the Linux kernel handling daylight savings time];
# when I ran ntpdate, the time became correct.
# Consequently, because my wife uses NT, 
# I accomodate NT by not running in UTC time but rather running 
# in local time.
# In ip-down, I set the hardware clock and /etc/adjtime with
#	/sbin/hwclock --set   --date="`/bin/date`"
/usr/sbin/ntpdate -t 8 -b -s black-ice.cc.vt.edu ntp.css.gov \
	louie.udel.edu  #Set the date now (xntpd will not change \
	                #time if greater than, for example, 45 minutes).
/usr/sbin/xntpd     #Continuously change the date; 
                    #This once ran on boot from within /etc/init.d/xntp3

# GET A BACKGROUND WEATHER MAP
lynx -source http://weather.yahoo.com/graphics/satellite/east_usa.jpg \
         >/var/tmp/satmap.jpg
# ENDING OF /etc/ppp/ip-up.d/dns-mail-news-time_jameson

-- 
Jim Burt, NJ9L,		Fairfax, Virginia, USA
jameson@mnsinc.com	http://www.mnsinc.com/jameson
jameson@pressroom.com	(703) 235-5213 ext. 132  (work)

"A poor man associating with a rich man will soon be too poor 
to buy even a pair of breeches."                   --Chinese Proverb


Reply to: