pavement

Resolv.conf

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
m (Reverted edits by 173.88.199.104 (talk) to last revision by Jimbo)
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
This file defines your search domains and your DNS servers. You probably don't want more than 4 to 6 search domains and you '''cannot''' have more than three DNS servers listed. The format is:
+
Located at /etc/resolv.conf, this file defines your search domains and your DNS servers. You probably don't want more than 4 to 6 search domains and you '''cannot''' have more than three DNS servers listed. The format is:
  
 
  domain freebsdwiki.net
 
  domain freebsdwiki.net
Line 5: Line 5:
 
  nameserver 172.16.1.1  
 
  nameserver 172.16.1.1  
  
[[Category:Important_Config_Files]]
+
To attempt to resolve incompletely qualified hostnames using more than one domain name if necessary, use:
 +
 
 +
  search freebsdwiki.net somethingelse.com anotherdomain.org
 +
 
 +
In plain english, that line means that if you try to '''ping webserver''' from the shell, your machine will try to resolve '''webserver.freebsdwiki.net''', '''webserver.somethingelse.com''', and '''webserver.anotherdomain.org''' before giving up.
 +
 
 +
Be careful with this, you really don't want to have every attempt at a DNS resolution take 15 seconds or more to time out because you have to contact tons of different nameservers due to your "search" string.  There is also a pretty obvious potential for namespace overlap and confusion, ie if you have distinct hosts named '''webserver''', '''fileserver''', or '''printserver''' (or whatever) in more than one of your search domains.
 +
 
 +
[[Category:Important_Config_Files]][[Category:Configuring FreeBSD]]

Latest revision as of 16:51, 25 August 2012

Located at /etc/resolv.conf, this file defines your search domains and your DNS servers. You probably don't want more than 4 to 6 search domains and you cannot have more than three DNS servers listed. The format is:

domain freebsdwiki.net
nameserver 169.254.1.1
nameserver 172.16.1.1 

To attempt to resolve incompletely qualified hostnames using more than one domain name if necessary, use:

 search freebsdwiki.net somethingelse.com anotherdomain.org

In plain english, that line means that if you try to ping webserver from the shell, your machine will try to resolve webserver.freebsdwiki.net, webserver.somethingelse.com, and webserver.anotherdomain.org before giving up.

Be careful with this, you really don't want to have every attempt at a DNS resolution take 15 seconds or more to time out because you have to contact tons of different nameservers due to your "search" string. There is also a pretty obvious potential for namespace overlap and confusion, ie if you have distinct hosts named webserver, fileserver, or printserver (or whatever) in more than one of your search domains.

Personal tools