LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 07-10-2008, 10:55 AM   #1
cornsnap
LQ Newbie
 
Registered: Mar 2007
Posts: 5

Rep: Reputation: 0
How to setup nslookups, queries using /etc/hosts as the default


Hello,

I am trying to setup so my server uses /etc/hosts as the default lookup method before DNS. I've changed /etc/nsswitch.conf (files dns) order but it doesn't work. Any other ideas?

thanks.
 
Old 07-10-2008, 11:09 AM   #2
mknirsch
Member
 
Registered: Feb 2003
Location: Germany
Distribution: SLES 10, SuSe 11.x
Posts: 31

Rep: Reputation: 16
dns with hosts.conf

Hi,
when I get you right you are looking for
/etc/hosts.conf

Insert or uncomment the entry

server=local,bind

This statements specifies a server program that inquires for a name or address to first look into /etc/hosts and then use NIS bind.

cheers

Martin
 
Old 07-10-2008, 11:20 AM   #3
cornsnap
LQ Newbie
 
Registered: Mar 2007
Posts: 5

Original Poster
Rep: Reputation: 0
host.conf

Thanks. I added this to the host.conf, it now looks like this:
Do I need to reboot or reread these files as it still looks at DNS first.
order hosts,bind
server=local,bind
 
Old 07-10-2008, 05:08 PM   #4
rajwinder
LQ Newbie
 
Registered: Jun 2008
Posts: 21

Rep: Reputation: 15
I doubt that u can force nslookup to use /etc/hosts file. dig can i think . or try "getent" which is used to read diff DB like passwd and hosts.. but lets say what experts needs to say
 
Old 07-10-2008, 08:21 PM   #5
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 59
nslookup performs its own resolving, and does not/will not uses /etc/hosts.

Also learn about /etc/nsswitch.conf
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
hostname, fqdn, /etc/hosts setup [GOD]Anck Slackware 9 07-20-2010 04:51 PM
setup domains in /etc/hosts tommy916 Linux - Networking 1 07-28-2006 05:19 PM
webalizer setup for virtual hosts intranet_man Linux - Security 1 03-03-2005 12:00 PM
How to setup virtual hosts for a web site? George2 Linux - Software 4 10-21-2003 03:46 AM
nslookups with BIND dunkyb Linux - Software 3 05-19-2003 08:10 AM


All times are GMT -5. The time now is 10:48 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration