LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Resolving names: DNS Forward over /etc/hosts priority? (https://www.linuxquestions.org/questions/linux-networking-3/resolving-names-dns-forward-over-etc-hosts-priority-784567/)

matiasar 01-25-2010 06:30 AM

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

AlucardZero 01-25-2010 04:53 PM

host.conf is a new one to me.

Try /etc/nsswitch.conf
Code:

hosts:          files dns

matiasar 01-26-2010 09:44 AM

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

rn_ 01-26-2010 10:05 AM

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.

matiasar 01-29-2010 07:07 AM

Yes, I'll try bypassing proxy. Must be that.

Thanks!

Quote:

Originally Posted by rn_ (Post 3841094)
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.



All times are GMT -5. The time now is 03:50 PM.