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

5,813

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:
5,813
proofit404
Author by

proofit404

I'm a programmer with interest in clojure, emacs, gnu, haskell, linux and mathematics. I also watch lots of anime and listen jrock. You always can find me with github linux.org.ru [email protected] irc: [email protected] jabber: [email protected] skype: proofit404

Updated on September 18, 2022

Comments

  • proofit404
    proofit404 over 1 year

    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?

    • week
      week over 11 years
      What about this one: dhcp_eth0="nodns" ?
    • proofit404
      proofit404 over 11 years
      Did you mean to specify dns name server in resolv.conf permanently?
  • proofit404
    proofit404 over 11 years
    Gentoo regenerate /etc/resolv.conf in every /etc/init.d/net.* start so this will not work.
  • Van Gale
    Van Gale about 11 years
    If you put dhcp_eth0="nodns" in your /etc/conf.d/net it won't regenerate resolv.conf.
  • Ярослав Рахматуллин
    Ярослав Рахматуллин about 11 years
    @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.