start a local caching DNS server

hello,

i was working on a script to emulate this hint from macosxhints.com:

http://www.macosxhints.com/article.php?story=20050420025219402

the script came along pretty well, does most of the things i’d like it to. however, at the end i need to set the DNS servers in the Network Preference Pane but i can’t find an acceptable way to do this. i have to leave it up to the user to do the setting (instructed from a display dialog box). therefore the script is not perfect, but if you understand what you are trying to do this will go a long way to getting things up and running.

as usual, i’d love to answer any questions or get any comments. here’s the code:


(* localCachingDNS will take care of most of the settings and set up the 
	DNS server.  You'll have to set your DNS entries to 127.0.0.1 for each 
	active interface you have in order to use the local DNS server *)

property rndcConf : "/usr/sbin/rndc-confgen > /etc/rndc.conf"
property rndcKeyGen : "/usr/bin/head -n 6 /etc/rndc.conf > /etc/rndc.key"
property startDNS : "/System/Library/StartupItems/BIND/BIND"
global tempDNS
global myDNS1
global myDNS2

(* letsGo() handles most of the initial config.  checks your current DNS 
	servers, but will let you use different ones if you desire *)
on letsGo()
	set tempDNS to {missing value}
	set currDNS to (do shell script "/bin/cat /etc/resolv.conf | grep 'nameserver'")
	set howMany to (count paragraphs of currDNS)
	set x to 1
	repeat while x ≤ howMany
		if word 2 of paragraph x of currDNS is not "127.0.0.1" then
			if tempDNS is {missing value} then
				set tempDNS to word 2 of paragraph x of currDNS as list
			else
				set tempDNS to tempDNS & word 2 of paragraph x of currDNS
			end if
		end if
		set x to (x + 1)
	end repeat
	try
		set myDNS1 to item 1 of tempDNS
		set myDNS2 to item 2 of tempDNS
	on error
		set myQ to button returned of (display dialog "You'll need to set your DNS numbers by hand.  Click \"Ok\" to continue.")
		if myQ is "Ok" then
			getDns()
		end if
	end try
	set myQ to button returned of (display dialog "Your current DNS servers are:  " & return & myDNS1 & return & " and " & return & myDNS2 & return & "Would you like to keep these or enter different ones?" buttons {"Keep", "Don't Keep"} default button "Keep")
	if myQ is "Keep" then
		doMain()
	else
		getDns()
	end if
end letsGo

(* doMain() just runs the other handlers in the proper order.  used for organizational
	purposes only *)
on doMain()
	doShell(rndcConf)
	doShell(rndcKeyGen)
	setHostConfig()
	setNamedConf(myDNS1, myDNS2)
	mkBINDDir()
	setLocalPref()
	
	doShell(startDNS)
end doMain

(* getDns() gets DNS numbers from the user if needed *)
on getDns()
	set firstQ to "You will need to enter two valid ip addresses to your DNS servers for this to work." & return & "Please enter the first DNS server's ip address:  "
	set secondQ to "Please enter the second DNS server's ip address:  "
	set myDNS1 to text returned of (display dialog firstQ default answer "")
	set myDNS2 to text returned of (display dialog secondQ default answer "")
	checkDNS(myDNS1)
	checkDNS(myDNS2)
	doMain()
end getDns

(* checkDNS(address) checks the users input for a valid ip address *)
on checkDNS(address)
	set badAns to address & " is not a valid DNS entry.  Please try again."
	set ASTD to AppleScript's text item delimiters
	set AppleScript's text item delimiters to "."
	set howMany to (count text items of address)
	set TI to text items of address
	set AppleScript's text item delimiters to ASTD
	if howMany is not 4 then
		display dialog badAns
		getDns()
		return
	end if
	
	set x to 1
	repeat while x ≤ howMany
		tell (text item x of TI) as number
			if it ≥ 0 and it < 256 then
				set x to (x + 1)
			else
				display dialog badAns
				getDns()
				exit repeat
			end if
		end tell
	end repeat
end checkDNS

(* doShell(a) is just an idea i had to save some typing.  i did not implement it in each handler *)
on doShell(a)
	do shell script a with administrator privileges
end doShell

(* setHostConfig() makes sure the DNS server is in /etc/hostconfig and is on when the computer boots *)
on setHostConfig()
	do shell script "#!/bin/sh
if [ ! -f /etc/hostconfig.OS-X_Original_DO_NOT_DELETE ]; then
    cp -p /etc/hostconfig /etc/hostconfig.OS-X_Original_DO_NOT_DELETE
fi

if [ -f /etc/hostconfig.OS-X_Original_DO_NOT_DELETE ]; then
    cp -p /etc/hostconfig.OS-X_Original_DO_NOT_DELETE /etc/hostconfig
fi" with administrator privileges
	set isDNSServer to "no"
	try
		set isDNSServer to (do shell script "/bin/cat /etc/hostconfig | /usr/bin/grep DNSSERVER")
	end try
	
	--display dialog isDNSServer
	if isDNSServer is "no" then
		do shell script "/bin/echo DNSSERVER=-YES- >> /etc/hostconfig" with administrator privileges
	else if isDNSServer is "DNSSERVER=-NO-" then
		do shell script "/usr/bin/sed 's/DNSSERVER=-NO-/DNSSERVER=-YES-/' /etc/hostconfig.OS-X_Original_DO_NOT_DELETE > /etc/hostconfig" with administrator privileges
	end if
end setHostConfig

(* setNamedConf(a, b) creates settings needed by our new DNS server *)
on setNamedConf(a, b)
	do shell script "#!/bin/sh
if [ ! -f /etc/named.conf.OS-X_Original_DO_NOT_DELETE ]; then
    cp -p /etc/named.conf /etc/named.conf.OS-X_Original_DO_NOT_DELETE
fi

if [ -f /etc/named.conf.OS-X_Original_DO_NOT_DELETE ]; then
    cp -p /etc/named.conf.OS-X_Original_DO_NOT_DELETE /etc/named.conf
fi" with administrator privileges
	set isForward to "no"
	try
		set isForward to (do shell script "/bin/cat /etc/named.conf | /usr/bin/grep 'forwarders {'")
		--display dialog isForward
	end try
	if isForward is "no" then
		do shell script "/bin/echo 'forwarders {
" & a & ";
" & b & ";
" & "};' >> /etc/named.conf" with administrator privileges
	else if isForward is "forwarders {" then
		--display dialog "Sed Command"
		do shell script "/usr/bin/sed '
/^forwarders {/ {
N
N
N
/\\n};/ {
s/forwarders {.*\\n.*\\n.*\\n};/\\
forwarders {\\
" & a & ";\\
" & b & ";\\
};/
}
}' /etc/named.conf.OS-X_Original_DO_NOT_DELETE > /etc/named.conf" with administrator privileges
	end if
end setNamedConf

(* mkBINDDir() creates our 'StartupItem' in the proper OS X way *)
on mkBINDDir()
	try
		do shell script "/bin/mkdir /System/Library/StartupItems/BIND" with administrator privileges
	end try
	do shell script "/bin/echo " & quoted form of "#!/bin/sh

. /etc/rc.common

if [ \"${DNSSERVER}\" = \"-YES-\" ]; then
	ConsoleMessage \"Starting BIND DNS Server\"
	/usr/sbin/named
fi" & " > /System/Library/StartupItems/BIND/BIND" with administrator privileges
	do shell script "/bin/chmod +x /System/Library/StartupItems/BIND/BIND" with administrator privileges
	do shell script "/bin/echo " & quoted form of "{
	Description = \"Local Caching DNS Server\";
	Provides = (\"DNS Server\");
	OrderPreference = \"None\";
	Messages =
	{
	start = \"Starting BIND DNS Server\";
	stop = \"Stopping BIND DNS Server\";
	};
}
" & " > /System/Library/StartupItems/BIND/StartupParameters.plist" with administrator privileges
end mkBINDDir

(* setLocalPref() just lets the user know to set DNS servers to the proper setting in the 
	Network Preference Pane.  wish i had a better way of doing this *)
on setLocalPref()
	tell application "System Preferences"
		activate
		set current pane to pane "com.apple.preference.network"
		display dialog "Please take out any 'DNS Servers' and replace them with '127.0.0.1'"
	end tell
end setLocalPref

(* Here's where the program starts *)
letsGo()

display dialog "The script is finished.  Enjoy your new Internet."

many thanks to Adam Bell and Bruce Phillips for help checking user entry of ip addresses. also, i implemented Adam’s idea of getting the currently set DNS numbers–works great.

cheers.

I’d love to use this, Walt but for one detail. If it doesn’t work or gives problems, how do I turn it off?

EDIT (ACB):

I’m running this now. The first time you visit an URL after this is installed will be slow while BIND builds a cache, but the second time you visit an URL – Wow! Instant. Thanks, Waltr.

hi adam,

all of the files that are changed by the script have thier old versions saved like this:


do shell script "#!/bin/sh
if [ ! -f /etc/hostconfig.OS-X_Original_DO_NOT_DELETE ]; then
cp -p /etc/hostconfig /etc/hostconfig.OS-X_Original_DO_NOT_DELETE
fi

if [ -f /etc/hostconfig.OS-X_Original_DO_NOT_DELETE ]; then
cp -p /etc/hostconfig.OS-X_Original_DO_NOT_DELETE /etc/hostconfig
fi" with administrator privileges

so if you wanted to go back to square one you could copy the files back. a thorough reading of the link provided to the macosxhints page would tell you what files are changed (if it’s not obvious from my script).

however, there are really only 2 things you need to do to turn this off. edit ‘/etc/hostconfig’ and set ‘DNSSERVER=-YES-’ to ‘DNSSERVER=-NO-’, then go to the Network Preference Pane and delete ‘127.0.0.1’. if you get your DNS servers through DHCP, then reboot. if not, set the servers in the Network Preference Pane and reboot.

even with the changes we made, they will not be used if the computer is a) not set to use them, and b) the DNS server is off.

i’ll look into adding some functionality to the script that will undo the changes later this week. it should not be hard considering that i’ve backed up the info already.

cheers!

hello,

here is the revised script that now includes an uninstall. running the uninstall will revert all of the settings that have been changed, but it is recommended that you reboot after uninstalling.

NOTE running the new uninstaller will revert a machine that used the original installer. everything was already built in.

here is the code:


(* localCachingDNS will take care of most of the settings and set up the 
	DNS server.  You'll have to set your DNS entries to 127.0.0.1 for each 
	active interface you have in order to use the local DNS server *)

property rndcConf : "/usr/sbin/rndc-confgen > /etc/rndc.conf"
property rndcKeyGen : "/usr/bin/head -n 6 /etc/rndc.conf > /etc/rndc.key"
property startDNS : "/System/Library/StartupItems/BIND/BIND"
global tempDNS
global myDNS1
global myDNS2
global myStatus

on myInit()
	set myInstall to button returned of (display dialog "This script will activate the local caching DNS server on your OS X Computer.  You can install, or uninstall." & return & "What would you like to do?" buttons {"Install", "Uninstall"} default button "Install")
	if myInstall is "Install" then
		letsGo()
	else if myInstall is "Uninstall" then
		revertAll()
	end if
end myInit

(* letsGo() handles most of the initial config.  checks your current DNS 
	servers, but will let you use different ones if you desire *)
on letsGo()
	set tempDNS to {missing value}
	set currDNS to (do shell script "/bin/cat /etc/resolv.conf | grep 'nameserver'")
	set howMany to (count paragraphs of currDNS)
	set x to 1
	repeat while x ≤ howMany
		if word 2 of paragraph x of currDNS is not "127.0.0.1" then
			if tempDNS is {missing value} then
				set tempDNS to word 2 of paragraph x of currDNS as list
			else
				set tempDNS to tempDNS & word 2 of paragraph x of currDNS
			end if
		end if
		set x to (x + 1)
	end repeat
	try
		set myDNS1 to item 1 of tempDNS
		set myDNS2 to item 2 of tempDNS
	on error
		set myQ to button returned of (display dialog "You'll need to set your DNS numbers by hand.  Click \"Ok\" to continue.")
		if myQ is "Ok" then
			getDns()
		end if
	end try
	set myQ to button returned of (display dialog "Your current DNS servers are:  " & return & myDNS1 & return & " and " & return & myDNS2 & return & "Would you like to keep these or enter different ones?" buttons {"Keep", "Don't Keep"} default button "Keep")
	if myQ is "Keep" then
		doMain()
	else
		getDns()
	end if
	set myStatus to 1
end letsGo

(* doMain() just runs the other handlers in the proper order.  used for organizational
	purposes only *)
on doMain()
	doShell(rndcConf)
	doShell(rndcKeyGen)
	setHostConfig()
	setNamedConf(myDNS1, myDNS2)
	mkBINDDir()
	setLocalPref()
	
	doShell(startDNS)
end doMain

(* getDns() gets DNS numbers from the user if needed *)
on getDns()
	set firstQ to "You will need to enter two valid ip addresses to your DNS servers for this to work." & return & "Please enter the first DNS server's ip address:  "
	set secondQ to "Please enter the second DNS server's ip address:  "
	set myDNS1 to text returned of (display dialog firstQ default answer "")
	set myDNS2 to text returned of (display dialog secondQ default answer "")
	checkDNS(myDNS1)
	checkDNS(myDNS2)
	doMain()
end getDns

(* checkDNS(address) checks the users input for a valid ip address *)
on checkDNS(address)
	set badAns to address & " is not a valid DNS entry.  Please try again."
	set ASTD to AppleScript's text item delimiters
	set AppleScript's text item delimiters to "."
	set howMany to (count text items of address)
	set TI to text items of address
	set AppleScript's text item delimiters to ASTD
	if howMany is not 4 then
		display dialog badAns
		getDns()
		return
	end if
	
	set x to 1
	repeat while x ≤ howMany
		tell (text item x of TI) as number
			if it ≥ 0 and it < 256 then
				set x to (x + 1)
			else
				display dialog badAns
				getDns()
				exit repeat
			end if
		end tell
	end repeat
end checkDNS

(* doShell(a) is just an idea i had to save some typing.  i did not implement it in each handler *)
on doShell(a)
	do shell script a with administrator privileges
end doShell

(* setHostConfig() makes sure the DNS server is in /etc/hostconfig and is on when the computer boots *)
on setHostConfig()
	do shell script "#!/bin/sh
if [ ! -f /etc/hostconfig.OS-X_Original_DO_NOT_DELETE ]; then
    /bin/cp -p /etc/hostconfig /etc/hostconfig.OS-X_Original_DO_NOT_DELETE
fi

if [ -f /etc/hostconfig.OS-X_Original_DO_NOT_DELETE ]; then
    /bin/cp -p /etc/hostconfig.OS-X_Original_DO_NOT_DELETE /etc/hostconfig
fi" with administrator privileges
	set isDNSServer to "no"
	try
		set isDNSServer to (do shell script "/bin/cat /etc/hostconfig | /usr/bin/grep DNSSERVER")
	end try
	
	--display dialog isDNSServer
	if isDNSServer is "no" then
		do shell script "/bin/echo DNSSERVER=-YES- >> /etc/hostconfig" with administrator privileges
	else if isDNSServer is "DNSSERVER=-NO-" then
		do shell script "/usr/bin/sed 's/DNSSERVER=-NO-/DNSSERVER=-YES-/' /etc/hostconfig.OS-X_Original_DO_NOT_DELETE > /etc/hostconfig" with administrator privileges
	end if
end setHostConfig

(* setNamedConf(a, b) creates settings needed by our new DNS server *)
on setNamedConf(a, b)
	do shell script "#!/bin/sh
if [ ! -f /etc/named.conf.OS-X_Original_DO_NOT_DELETE ]; then
    /bin/cp -p /etc/named.conf /etc/named.conf.OS-X_Original_DO_NOT_DELETE
fi

if [ -f /etc/named.conf.OS-X_Original_DO_NOT_DELETE ]; then
    /bin/cp -p /etc/named.conf.OS-X_Original_DO_NOT_DELETE /etc/named.conf
fi" with administrator privileges
	set isForward to "no"
	try
		set isForward to (do shell script "/bin/cat /etc/named.conf | /usr/bin/grep 'forwarders {'")
		--display dialog isForward
	end try
	if isForward is "no" then
		do shell script "/bin/echo 'forwarders {
" & a & ";
" & b & ";
" & "};' >> /etc/named.conf" with administrator privileges
	else if isForward is "forwarders {" then
		--display dialog "Sed Command"
		do shell script "/usr/bin/sed '
/^forwarders {/ {
N
N
N
/\\n};/ {
s/forwarders {.*\\n.*\\n.*\\n};/\\
forwarders {\\
" & a & ";\\
" & b & ";\\
};/
}
}' /etc/named.conf.OS-X_Original_DO_NOT_DELETE > /etc/named.conf" with administrator privileges
	end if
end setNamedConf

(* mkBINDDir() creates our 'StartupItem' in the proper OS X way *)
on mkBINDDir()
	try
		do shell script "/bin/mkdir /System/Library/StartupItems/BIND" with administrator privileges
	end try
	do shell script "/bin/echo " & quoted form of "#!/bin/sh

. /etc/rc.common

if [ \"${DNSSERVER}\" = \"-YES-\" ]; then
	ConsoleMessage \"Starting BIND DNS Server\"
	/usr/sbin/named
fi" & " > /System/Library/StartupItems/BIND/BIND" with administrator privileges
	do shell script "/bin/chmod +x /System/Library/StartupItems/BIND/BIND" with administrator privileges
	do shell script "/bin/echo " & quoted form of "{
	Description = \"Local Caching DNS Server\";
	Provides = (\"DNS Server\");
	OrderPreference = \"None\";
	Messages =
	{
	start = \"Starting BIND DNS Server\";
	stop = \"Stopping BIND DNS Server\";
	};
}
" & " > /System/Library/StartupItems/BIND/StartupParameters.plist" with administrator privileges
end mkBINDDir

(* setLocalPref() just lets the user know to set DNS servers to the proper setting in the 
	Network Preference Pane.  wish i had a better way of doing this *)
on setLocalPref()
	tell application "System Preferences"
		activate
		set current pane to pane "com.apple.preference.network"
		display dialog "Please take out any 'DNS Servers' and replace them with '127.0.0.1'"
	end tell
end setLocalPref

on revertAll()
	do shell script "#!/bin/sh
if [ -f /etc/hostconfig.OS-X_Original_DO_NOT_DELETE ]; then
    cp -p /etc/hostconfig.OS-X_Original_DO_NOT_DELETE /etc/hostconfig
fi" with administrator privileges
	do shell script "#!/bin/sh
if [ -f /etc/named.conf.OS-X_Original_DO_NOT_DELETE ]; then
    cp -p /etc/named.conf.OS-X_Original_DO_NOT_DELETE /etc/named.conf
fi" with administrator privileges
	--do shell script 
	do shell script "/bin/rm -rf /System/Library/StartupItems/BIND" with administrator privileges
	do shell script "/bin/rm -rf /etc/hostconfig.OS-X_Original_DO_NOT_DELETE" with administrator privileges
	do shell script "/bin/rm -rf /etc/named.conf.OS-X_Original_DO_NOT_DELETE" with administrator privileges
	tell application "System Preferences"
		activate
		set current pane to pane "com.apple.preference.network"
		display dialog "Please take out the entry '127.0.0.1' and replace it with your regular DNS server ip addresses.  If you get your DNS server ip addresses through DHCP, you can leave this blank."
	end tell
	set myStatus to 0
end revertAll

(* Here's where the program starts *)
myInit()

if myStatus is 1 then
	display dialog "The script is finished.  Enjoy your new Internet."
else if myStatus is 0 then
	display dialog "The script is finished.  You have reverted to your original settings"
end if

cheers.

thanx walter!

i tried your script----but i’m not sure if it’s working for me for several reasons-----

1- my speed doesn’t seem faster

2- i get an error message in AppleScript:
AppleScript Error
Starting BIND DNS Server

does this mean there’s a problem?

3- i’m using the latest tiger 10.4.8 on a new macbook(black)
i live in korea and use my university’s LAN connection.
i manually enter my ip address, subnet mask, router address, and domain name to my [b]Airport Express router
and then choose configure IPv4 with DHCP when configurin my airport network in the preferences panel.

my main question, in addition to #2 above about the error message-------is whether your instructions for the
127.0.0.1 entries for thr dns server is meant for
a-my airport express setting for the router? or
b-my network setting? for my airport card or
c-both?

thanx,
jeff

Model: macbook
AppleScript: AppleScript 1.10.7 Version 2.1.1 (81)
Browser: Firefox 2.0 camino safari
Operating System: Mac OS X (10.4)

no problem

if the script does not work for any reason, you won’t get an increase in speed. keep in mind that the script works first, and then you see the speed increase. see below.

yes. you may need to read the original article to get an idea of what’s going on here. does the console also show this message after a reboot? there may be a permissions problem, or it could be something did not get written properly. you don’t seem to have done any troubleshooting, my first suggestion would be to use the uninstall option and the try it again. if you get the same problem, you may have to investigate the files and try to figure out what the problem is. i’ve used this on 10.4 and had no problems. a wireless interface should not matter.

none of this should matter.

jeff, keep in mind that the script is written to be run on a Macintosh computer. it has nothing to do with the way you set up your Airport Express. even if you give out DNS numbers with the Airport via DHCP, adding the localhost (ie, 127.0.0.1) as a DNS entry will cause the Mac to use the caching DNS server first and failover to the DNS info you give out from the DHCP. of course the DNS server has to be running for this to work.

as you will see from the macosxhints article, the tip does not work for everyone. my hope is that this script aleviates some of the setup problems that have been experienced (as it is a difficult tip if you are not comfortable with the command line) and helps some people to get it working, but unfortunately i can not guaratee that it will work (or even be beneficial) for everyone.

i wish you luck…

hi walter:

thanx for your reply.
ive tried a lot of trouble shooting actually—including others dns server suggestions as mentioned below—both for the airport express and the network preferences.
it’s a bit confusing----seems i enter my ip address and other info into my airport express settings, and then it assigns an ip address to my computer—
and then you suggest to load your script and change the dns settings for my computer----correct?

none of this will matter i suppose, if i can’t load your script without taht error message.

you wrote:
“you may need to read the original article to get an idea of what’s going on here. does the console also show this message after a reboot?”

yes it does


"there may be a permissions problem, or it could be something did not get written properly. you don’t seem to have done any troubleshooting, my first suggestion would be to use the uninstall option and the try it again. "

tried this many times


"if you get the same problem, you may have to investigate the files and try to figure out what the problem is. “i’ve used this on 10.4 and had no problems. a wireless interface should not matter.”

what do you mean? can you be more specific?
why wouldn’t it work—why would i get the error message i described:
AppleScript Error
Starting BIND DNS Server

i’ve never used mac scripter before this----i just copied the whole thing that you wrote into a window, hit compile and run-----
i think it worked at first---- don’t remember actually-----
does your script----if it works----- “stick” after its been run----or does it have to be run every time i boot and/or close the script window?

“jeff, keep in mind that the script is written to be run on a Macintosh computer. it has nothing to do with the way you set up your Airport Express. even if you give out DNS numbers with the Airport via DHCP, adding the localhost (ie, 127.0.0.1) as a DNS entry will cause the Mac to use the caching DNS server first and failover to the DNS info you give out from the DHCP. of course the DNS server has to be running for this to work.”

ok----i assume you’re familiar with airport express–which when setting up also asks for DNS entries.
so, when using your script and doing what you said, what numbers should i enter for the airport express DNS servers? should i use the numbers suggested by:
my university: 164.125.9.2
or
open dns:
208.67.222.222
208.67.220.220
or
your bind dns:
127.0.0.1

none of this will matter i suppose, if i can’t load your script without tht error message.

thanx in advance!
jeff

Model: macbook
AppleScript: AppleScript 1.10.7 Version 2.1.1 (81)
Browser: Firefox 2.0 camino safari
Operating System: Mac OS X (10.4)

hi jeff,

this seems to be the crux of the matter. i really don’t know why you are getting the error. the original article specifies all of the files that are changed by my DNS script, and the script follows that article pretty faithfully. the files will look as they are specified in the original article. i’m sorry i don’t have time right now to go through and list them but i’m in a crunch mode that will not allow me to do that.

welcome to MacScripter! the script makes changes to files that will cause the DNS service to activate and run each time the machine boots. in other words, it “sticks”.

yes, most definitely. i’m familiar with routers in general.

any of those would be good. but not:

because that is the ‘loopback’ interface. basically, by setting that number as your DNS entry, the computer will look for local answers first. in my experience, by putting that in the Network Control Panel the Mac will look locally first, and then use the numbers supplied by DHCP as a failover–this is good!

from the wikipedia article:

Most IP implementations support a loopback interface, which represents the loopback facility. Any traffic that a computer program sends on the loopback network is addressed to the same computer. The most commonly used IP address on the loopback network is 127.0.0.1 for IPv4 and ::1 for IPv6. The standard domain name for this address is localhost. A loopback interface is a type of 'circuitless IP address' or 'virtual IP' address, as the IP address is not associated with any one particular interface (or circuit) on the host or router.

yes, i think you are totally correct here. i really think the answer lies in reading the article very closely and looking at the files it specifies and seeing what does not match up. post questions here and i’ll do my best to help.

cheers.

waltr;

I’ve been using this for quite a while now, but it occurs to me that a nice adder would be a companion script to check that your caching DNS server was actually functioning. Among my root processes is “dnsupdate”. Is that it? (I’m not willing to uninstall to see if that goes away, and thought you might know).

hi Adam,

i also use this, and it has worked like a charm from day one. however, you have an interesting question. the name of the program is BIND, and it’s executable is /usr/sbin/named. i always thought it would show up as /usr/sbin/named in ‘top’, ‘ps’ or the Activity Monitor. strangely, it does not on my machine. i think it did before (possibly in 10.3).

i’m kind of scratching my head on this one. my internet is definitely faster, yet i don’t see ‘named’ as a process. i do have mDNSresponder though. i’ll have to look into this.

ETA: mDNSresponder has to do w/ Bonjour. i’ll keep looking.

cheers.

Thanks for responding waltr;

Reading the man page for lookupd, it seems to have one or more embedded DNSAgents that prepare caches. Perhaps these are only active as required.

this reply is to walter from his post to me on the below date:
2006-12-04 01:46:56
waltr

figured i’d give this another try…

here is what happens:

1- i paste the script into the script editor window and hit run
2- a pop-up dialog window asks me if i’d like to install or uninstall---- i choose install
3- another pop-up dialog window tells me i’ll “need to set your DNS numbers by hand.”— i click OK to continue
4- another pop-up dialog window says "you will need to enter two valid ip addresses to your DNS servers for this to work. please enter the first DNS server’s ip address:

WHAT DOES THIS MEAN???
do i enter the same number twice?
which number(s) should i enter???
am i supposed to enter the IP address assigned by my router (10.0.1.2), or the IP address assigned by my internet provider (164.125.26.118), or the DNS you give for your script (127.0.0.1)

5- and then another which says please enter second DNS server’s ip address (i’ve tried entering all of the above choices)
6- then another window saying please take out any DNS servers and replace them with 127.0.0.1-- and when i click OK to close that dialog box— i get an error message saying:

AppleScript Error:
Starting BIND DNS Server

SO WHATS MY PROBLEM?