Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 11-01-2003, 08:40 AM   #1
Registered: Nov 2003
Posts: 82

Rep: Reputation: 15
/etc/hosts resolving before DNS resolving ?

Hi ,

I am running RED HAT 8.

I have 2 ethernet interfaces.

-1 eth interface is a DHCP client (and gets IP + DNS entries via DHCP). This interface is connected to an antranet with DNS servers on.

-1 eth interface has a static ip address. This interface is connected to a small LAN

In /etc/hosts, I created some entries that make part of the LAN that is connected to the static interface :
more /etc/hosts server2 server3

when I do : ping server2
I notice that the RED HAT sends out a DNS request via the DHCP interface.
Off course there is no reply from that server.
then I got reply message from !!!
I see that no ping request goes out on my static eth interface !!

So, I have following questions :
1. Why does the RED HAT does not look in my /etc/hosts file ?
2. Is there a possibility to first look in /etc/hosts before sending a DNS request ?
Old 11-01-2003, 09:20 AM   #2
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Welcome to LQ.

The config file /etc/host.conf contains the configuration for name resolution order - for more info see:
man host.conf
Old 11-02-2003, 04:39 AM   #3
Registered: Nov 2003
Posts: 82

Original Poster
Rep: Reputation: 15
I looked in the file /etc/host.conf and it contains following line :

order hosts,bind

This means that first hosts file will be looked up and afterwards the bind.

So why does my box first looks out on DNS ?

On my box, IP forwarding is enabled. Can this be a problem ?
Old 11-02-2003, 05:39 AM   #4
LQ Guru
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
are teh IPs (10.10.10.X) pingable?
Old 11-02-2003, 05:54 AM   #5
Registered: Nov 2003
Posts: 82

Original Poster
Rep: Reputation: 15
Problem is solved.
For a reason I do not understand, server2 was assigned to in my hosts file.

Since you normally do not need to touch in the hosts file, I completely overlooked this.

I removed the server2 entry from the hosts entry, and problem is solved.

Anyway, I learned that there is a way in changing the resolving order via /etc/host.conf.

This flexibility is according to me not possible on any WIN* platform.

Thansk for your time !


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
Hosts not resolving drguitarum2005 SUSE / openSUSE 2 07-08-2005 01:42 PM
problem resolving external hosts safia Linux - Networking 4 03-22-2005 06:15 PM
Resolving hosts slooooow Latem Mandriva 1 03-16-2005 09:25 PM
Problem with resolving hosts p0rky Linux - Newbie 1 07-15-2004 05:51 AM
Mozilla resolving hosts problem steve7575 Linux - Software 5 06-13-2004 08:06 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:05 PM.

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