[CALUG] /etc/hosts not used?

Eldon Ziegler eldonz39yid at yahoo.com
Sun Mar 19 12:26:04 CST 2006


Thanks. Looks like it does the job. I hadn't run across it before.

At 12:03 pm 3/19/2006, Chris Edillon wrote:
>On Sun, 2006-03-19 at 07:37 -0500, Eldon Ziegler wrote:
>
> > In looking for a command to use in a shell script that would first
> > search /etc/hosts and then DNS I didn't want to reinvent the wheel
> > but, in this case, there doesn't seem to be a wheel so I wrote a C
> > routine to printf the result of gethostbyname () which seems to do
> > the search in the order I want.
> >
>   the getent command will do what you want, it's a program which
>does various get* routine lookups:
>
>getent hosts foo.bar.com
>getent passwd username
>getent group groupname
>etc.
>
>chris
>
>_______________________________________________
>Columbia, Maryland Linux User's Group (CALUG) mailing list
>CALUG Website: http://www.calug.com
>Email postings to: lug at calug.com
>Change your list subscription options: http://calug.com/mailman/listinfo/lug



More information about the lug mailing list