Using NetInfo like a hosts file

To modify how hosts are searched for (ie, look in NetInfo before DNS), see the manpage for lookupd; basically,

- create a file, /etc/lookupd/hosts and add the line,

LookupOrder CacheAgent NIAgent DNSAgent NILAgent

- then HUP lookupd (kill -1 `cat /var/run/lookupd.pid`)

To verify,

- run lookupd -d and enter 'configuration' at the '>' prompt. Among other entries, there should be

Dictionary: "Host Configuration"
LookupOrder: CacheAgent NIAgent DNSAgent NILAgent
_config_name: Host Configuration

Before doing this, it looks like,

Dictionary: "Host Configuration"
LookupOrder: CacheAgent DNSAgent NIAgent
_config_name: Host Configuration


One strange thing is lookupd complains about a configuration failure (both on stdout from lookupd -d and in /var/log/netinfo.log when restarting lookupd) but it obviously takes the change.
 
excellent documentation, you rock. But allow my experience on this one to correct your sole mistake...
leave out the NILAgent entirely. That's what you don't have configured correctly. Also Apple doesn't recommend using the NILAgent for normal use. Neither do I. I believe the phrase they used to describe the NILAgent was "morally questionable"
The NILAgent will store failed requests for things and if you request again (within its timeout) it will instantly respond no again without even trying. This means that if you tried to open a folder and you didn't have permissions, you could change the permissions and you still wouldn't be able to get in until the NILAgent expired the entry.

Long story short, unless you're on a crazy heavy hit server with wacked permissions (like me:) leave out the NILAgent in its entirety. This should clear up your error.
 
About NILAgent, guess that's what happens when you follow the manpage example too closely, and only skim the description of NILAgent...I do notice the manpage does mention use of NILAgent is "controversial". But at least it states a timeout of only 60 seconds.
 
Nice!!!

I just realized that I could not browse to my Windoze Web server which I have always had listed in my OS 9.x hosts file as "w2k".

Before doing anything else, I came here to MacOSX.com and did a search. This thread was the 2nd thing listed in the results.

All told, this problem took less than 3 minutes to solve.

Thanks!!! This forum ROCKS! (And I'm not someone who says that often. :p )
 
I must agree this forum does indeed rock. It's the easiest to use and it's email updates are very intelligent.

I wonder if I can get a copy of this script for my web server
 
:confused:
I found and followed this thread with interest, but I still can't get netinfo to recognise an alias.

I tried the following:
my /etc/hosts includes something like the following:
123.4.567.8 some.domain.com alias1
23.45.67.89 alias2

I then did an niload hosts . < /etc/hosts

Checking Netinfo / machines /
some.domain.com
ip_address 123.4.567.8
name (some.domain.com, alias1)

alias2
ip_address 23.45.67.89
name alias2


when I try to ssh either alias1 or alias2, I get a 'No address associated to the name' err.

I restarted all domains thru netinfo - no joy.
I followed blb and theeds advice on the LookupOrder - still no joy

any ideas where I'm going wrong - can Netinfo handle alias'??

K.
 
Originally posted by kastro
:confused:
. . .

when I try to ssh either alias1 or alias2, I get a 'No address associated to the name' err.

I restarted all domains thru netinfo - no joy.
I followed blb and theeds advice on the LookupOrder - still no joy

any ideas where I'm going wrong - can Netinfo handle alias'??

K.

I've never tried what you outline here. I've only duplicated existing entries using Netinfo Manager and then edited them (as described at the begining of the thread). When I get my hands on an OSX machine I'll try your steps.
 
Back
Top