How I can setup dns settings in my Gentoo linux box? nslookup already do it

3

1

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?

proofit404

Posted 2012-11-14T17:09:46.473

Reputation: 279

1What about this one: dhcp_eth0="nodns" ? – week – 2012-11-14T17:22:57.527

Did you mean to specify dns name server in resolv.conf permanently? – proofit404 – 2012-11-14T17:25:28.370

Answers

2

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
)

week

Posted 2012-11-14T17:09:46.473

Reputation: 3 128

-3

Any distro:

echo nameserver 10.3.0.1 > /etc/resolv.conf

Ярослав Рахматуллин

Posted 2012-11-14T17:09:46.473

Reputation: 9 076

1Gentoo regenerate /etc/resolv.conf in every /etc/init.d/net.* start so this will not work. – proofit404 – 2012-11-15T16:52:55.813

If you put dhcp_eth0="nodns" in your /etc/conf.d/net it won't regenerate resolv.conf. – Van Gale – 2013-04-26T06:48:26.723

@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. – Ярослав Рахматуллин – 2013-04-26T10:55:41.823