LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-06-2005, 10:41 PM   #1
mikeheggy
Member
 
Registered: Jan 2005
Posts: 37

Rep: Reputation: 15
Linux hosts file problem


Hey everyone,

I've been using a small server for my LAN for a little while now. It has Trustix Secure Linux 2.0 on it. Before now, I never bothered to configure the /etc/hosts file.

Now, I completely don't understand what's going wrong. My /etc/hosts file looks like this:

Code:
127.0.0.1 localhost.localdomain localhost
192.168.1.196 server1.lan
Now, I can query outside names with the hosts command, like "host google.com". But, "host server1.lan" or even "host localhost" doesn't work.

/etc/resolv.conf has my ISP's DNS servers. /etc/host.conf has "order hosts,bind"

Last, /etc/nsswitch.conf has "hosts: files nisplus dns"

Why doesn't my hosts file work!?

Thanks in advance,
Mike
 
Old 01-06-2005, 11:18 PM   #2
oulevon
Member
 
Registered: Feb 2001
Location: Boston, USA
Distribution: Slackware
Posts: 438

Rep: Reputation: 30
Are you using DHCP?
 
Old 01-07-2005, 04:49 PM   #3
mikeheggy
Member
 
Registered: Jan 2005
Posts: 37

Original Poster
Rep: Reputation: 15
DHCP is enabled on the network, but its not enabled for the server in question. I assign the IP address manually.
 
Old 01-08-2005, 06:21 AM   #4
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
host is a tool to query DNS server, not like other network tools which use system order
query defined in /etc/host.conf

it is like dig or nslookup

server1.lan should be resolved with program like ping, nmap, etc...
 
Old 01-08-2005, 11:52 AM   #5
mikeheggy
Member
 
Registered: Jan 2005
Posts: 37

Original Poster
Rep: Reputation: 15
My mistake. Thanks for clarifying that, Cedrik.
 
  


Reply



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
Is there a hosts file on linux? rwalkerphl Linux - Newbie 2 08-19-2004 01:43 PM
does the /etc/hosts file work same as the M$ hosts file? Lleb_KCir Linux - Software 6 04-03-2004 04:33 PM
where is the hosts file in linux Lleb_KCir Linux - General 8 03-27-2004 10:59 AM
Windows using Linux Hosts file RJC Linux - General 0 08-20-2002 08:52 AM
Hosts.allow file skopje909 Linux - Security 3 11-16-2001 09:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:39 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration