Re: [Fed-Talk] Reading etc hosts file
Re: [Fed-Talk] Reading etc hosts file
- Subject: Re: [Fed-Talk] Reading etc hosts file
- From: Michael Pike <email@hidden>
- Date: Thu, 6 Oct 2005 11:54:53 -0600
Thanks for the info! Very useful!
I wonder how many of us (I am one) are old Linux people (Redhat, SuSE,
etc) that saw OS X and fell in love.
mike
On 10/6/05, Dalton Hamilton <email@hidden> wrote:
> This process tells you how to change the name resolution order in OS
> X much just like you can do with any linux system and is essentially
> the same thing as having to modify the /etc/nsswitch.conf file in
> Redhat.
>
> I see this more on OS X Server but sometime on my home systems. I'll
> modify the /etc/hosts file and the systems will continue to use the
> old IP address. This torques my screws when I'm trying to debug a
> network problem -- I normally don't have time for this. So I finally
> decided to lookup the simple answer -- as I did many years ago with
> Redhat/SuSe.
>
> Here is how I fixed this:
>
> 1. First look at how the system's lookupd process is setup. Issue
> the "lookupd -configuration" command. You'll see a line something
> like this:
>
> LookupOrder: Cache FF DNS NI DS
>
> Which states, resolution will happen by first looking in the cache
> (12 hr timeout), then the flat files (like /etc/hosts), then DNS,
> NetInfo, then Directory Services. If you do a man on lookupd it
> gives me some garbage about verification to ensure the data isn't out-
> of-date, but I didn't really look at it because I know it isn't
> working and I know how I want it to work -- i.e. go look at the /etc/
> hosts file which in this case is the FF which stands for flat files.
>
> 2. I like FF to be first. I created a directory /etc/lookupd
> 3. Then issue this command: "echo LookupOrder FF NI DNS DS > /etc/
> lookupd/hosts"
> 4. Then to make lookupd change its behavior immediately without
> having to reboot, send it a HUP signal. First get the process ID "ps
> -aux | grep lookupd"
>
> root 80 0.0 -0.1 29312 1116 ?? Ss Mon07AM
> 0:23.38 /usr/sbin/lookupd
>
> Here is a line similar to what you'll see. The process ID is 80 in
> this case.
>
> 5. Given the example above, with process id of 80, you'd then send
> it the HUP signal "kill -HUP 80"
>
> Hope this causes less stress in your lives - :-).
>
>
> Dalton Hamilton
>
>
>
>
>
> On Oct 6, 2005, at 6:26 PM, Pike, Michael (NNMC) wrote:
>
> > That did the trick!
> >
> > I thought it was always supposed to consult the hosts file before
> > going
> > to DNS lookup. Learn something new everyday :)
> >
> > Mike
> >
> >
> > -----Original Message-----
> > From: fed-talk-bounces+michael.pike=email@hidden
> > [mailto:fed-talk-bounces+michael.pike=email@hidden] On
> > Behalf
> > Of Brian Raymond
> > Sent: Thursday, October 06, 2005 10:24 AM
> > To: Michael Pike; email@hidden
> > Subject: Re: [Fed-Talk] Reading etc hosts file
> >
> > It should handle new additions that haven't already been resolved
> > elsewhere
> > without an issue but I would assume if it's not handling updates
> > flushing
> > your lookup cache should take care of it.
> >
> >
> >> lookupd -flushcache
> >>
> >
> > - Brian
> >
> >
> > On 10/6/05 11:55 AM, "Michael Pike" <email@hidden> wrote:
> >
> >
> >> Anyone have a quick and dirty way to refresh the network so it reads
> >> the /etc/hosts files after it has been changed?
> >>
> >> Updates made to that file do not appear to take effect unless you
> >> restart the system, or sometimes just disabling the network for a few
> >> seconds and re-enabling it work, but then I have to restart all my
> >> apps that used the initial connection.
> >> mike
> >>
> >>
> >> --
> >> "I never loved email, until I found GMail." - Mike Pike, 2005
> >> _______________________________________________
> >> Do not post admin requests to the list. They will be ignored.
> >> Fed-talk mailing list (email@hidden)
> >> Help/Unsubscribe/Update your Subscription:
> >>
> >>
> > 40dataline
> > .com
> >
> >>
> >> This email sent to email@hidden
> >>
> >>
> >
> > _______________________________________________
> > Do not post admin requests to the list. They will be ignored.
> > Fed-talk mailing list (email@hidden)
> > Help/Unsubscribe/Update your Subscription:
> >
> > This email sent to email@hidden
> > _______________________________________________
> > Do not post admin requests to the list. They will be ignored.
> > Fed-talk mailing list (email@hidden)
> > Help/Unsubscribe/Update your Subscription:
> > 40mac.com
> >
> > This email sent to email@hidden
> >
>
>
--
"I never loved email, until I found GMail." - Mike Pike, 2005
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Fed-talk mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden