Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I can't resolve dns requests for most of programs in my Gentoo machine. I have local network at my work. It contain two dns services for local machine names and one tmg gateway for internet access.

I can't resolve dns names which must be processed by service of our internet provider.

Here is my /etc/conf.d/net configuration:

dns_domain_lo="local"
config_eth0="dhcp"
routes_eth0=(
  "default gw 131.107.1.20" # gateway of my local network
)
dns_servers_eth0=(
  "195.20.194.2"            # internet provider dns server
)

After I run /etc/init.d/net.eth0 restart /etc/resolv.conf doesn't contain specified dns server. Only two local servers which were accepted from local dhcp service.

But I cat get appropriate ip address with nslookup www.google.com and successful open it with internet browser.

Where I make mistake?

share|improve this question
1  
What about this one: dhcp_eth0="nodns" ? –  week Nov 14 '12 at 17:22
    
Did you mean to specify dns name server in resolv.conf permanently? –  proofit404 Nov 14 '12 at 17:25

2 Answers 2

up vote 2 down vote accepted

This'll do..

dns_domain_lo="local"
config_eth0="dhcp"
dhcp_eth0="nodns"
routes_eth0=(
  "default gw 131.107.1.20" # gateway of my local network
)
dns_servers_eth0=(
  "195.20.194.2"            # internet provider dns server
)
share|improve this answer
    
Thanks, it work :) –  proofit404 Nov 14 '12 at 17:39

Any distro:

echo nameserver 10.3.0.1 > /etc/resolv.conf

share|improve this answer
1  
Gentoo regenerate /etc/resolv.conf in every /etc/init.d/net.* start so this will not work. –  proofit404 Nov 15 '12 at 16:52
    
If you put dhcp_eth0="nodns" in your /etc/conf.d/net it won't regenerate resolv.conf. –  Van Gale Apr 26 '13 at 6:48
    
@proofit404 Yes it will. Don't trust me? man resolv.conf. Apart from the /etc/init.d/net.lo script's capabilities of setting DNS you could override anything it does by a simple "/etc/init.d/afternet service" that loads after net.* and runs that command. –  Ярослав Рахматуллин Apr 26 '13 at 10:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.