Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
11-01-2003, 08:40 AM
|
#1
|
Member
Registered: Nov 2003
Posts: 82
Rep:
|
/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
10.10.10.2 server2
10.10.10.3 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 127.0.0.1 !!!
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 ?
|
|
|
11-01-2003, 09:20 AM
|
#2
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
Welcome to LQ.
The config file /etc/host.conf contains the configuration for name resolution order - for more info see:
man host.conf
|
|
|
11-02-2003, 04:39 AM
|
#3
|
Member
Registered: Nov 2003
Posts: 82
Original Poster
Rep:
|
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 ?
|
|
|
11-02-2003, 05:39 AM
|
#4
|
LQ Guru
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280
Rep:
|
are teh IPs (10.10.10.X) pingable?
|
|
|
11-02-2003, 05:54 AM
|
#5
|
Member
Registered: Nov 2003
Posts: 82
Original Poster
Rep:
|
Problem is solved.
For a reason I do not understand, server2 was assigned to 127.0.0.1 in my hosts file.
Since you normally do not need to touch 127.0.0.1 in the hosts file, I completely overlooked this.
I removed the server2 entry 127.0.0.1 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 !
|
|
|
All times are GMT -5. The time now is 09:10 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|