LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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-25-2010, 07:30 AM   #1
matiasar
Member
 
Registered: Nov 2006
Location: Argentina
Distribution: Debian
Posts: 314
Blog Entries: 1

Rep: Reputation: 31
Resolving names: DNS Forward over /etc/hosts priority?


Hello all.
Through the lasts days I've trying to solve this "problem" without success yet.

In my network my proxy / firewall (iptables + squid) works as dns forwarder.
I needed to configure an url at my /etc/hosts in my linux boxes which are behind the firewall into the lan.
I want my machine to look at its local /etc/hosts file before querying the dns to the firewall. Despite I configured my /etc/host.conf this way:

/etc/host.conf:

multi on
order hosts,bind

And the /etc/hosts:

pub.lic.ip.add my.url.com.ar

(where pub.lic.ip.add is the ip address of the web server and "my.url.com.ar" the url).

My machine keeps resolving the name through the dns forwarder (firewall) and not from the /etc/hosts file first.

Is there any action needed after configuring /etc/host.conf? Any service to restart?
Something could be missing?

Thanks in advance,
Matías
 
Old 01-25-2010, 05:53 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,652

Rep: Reputation: 536Reputation: 536Reputation: 536Reputation: 536Reputation: 536Reputation: 536
host.conf is a new one to me.

Try /etc/nsswitch.conf
Code:
hosts:          files dns
 
Old 01-26-2010, 10:44 AM   #3
matiasar
Member
 
Registered: Nov 2006
Location: Argentina
Distribution: Debian
Posts: 314
Blog Entries: 1

Original Poster
Rep: Reputation: 31
AlucardZero,

Thanks for your response.
I took a glance at my /etc/nsswitch.conf and this entry was already there.

Code:
hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
If I do:
Code:
$ping urlinetchost
And it gets the IP which is registered in /etc/hosts ok. But I think the problem is with the web browser, which seems to be resolving the name through the firewall (dns forwarder). I'll try to see with tcpdump to try to check which IP is resolving when using web browser.

Thanks a lot
 
Old 01-26-2010, 11:05 AM   #4
rn_
Member
 
Registered: Jun 2009
Location: Orlando, FL, USA
Distribution: Suse, Redhat
Posts: 127
Blog Entries: 1

Rep: Reputation: 25
What browser are you using? Firefox? Most browsers have proxy settings. Please check to see if your browser is using it. In firefox it's under tools->options->advanced->network->settings. In case it is using proxy settings, then everything would route through that.
 
Old 01-29-2010, 08:07 AM   #5
matiasar
Member
 
Registered: Nov 2006
Location: Argentina
Distribution: Debian
Posts: 314
Blog Entries: 1

Original Poster
Rep: Reputation: 31
Yes, I'll try bypassing proxy. Must be that.

Thanks!

Quote:
Originally Posted by rn_ View Post
What browser are you using? Firefox? Most browsers have proxy settings. Please check to see if your browser is using it. In firefox it's under tools->options->advanced->network->settings. In case it is using proxy settings, then everything would route through that.
 
  


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
syslog-ng not resolving DNS names noir911 Linux - Server 2 07-28-2008 04:02 AM
resolving LAN hosts as DNS Harry2o Linux - Networking 7 09-01-2006 11:31 PM
My box is not resolving dns names. Waht can i do ? rubenscript Linux - Networking 18 05-01-2006 02:43 AM
DNS - resolving names without needing the FQDN ehorton Linux - Newbie 5 01-16-2006 09:43 PM
/etc/hosts resolving before DNS resolving ? markraem Linux - Networking 4 11-02-2003 05:54 AM


All times are GMT -5. The time now is 04:07 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration