12.07.2015 Views

download

download

download

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Network Configuration—BasicsName ResolutionThere are various sources that a host may use to translate hostnames to IP addresses.The most common methods are the DNS and hosts file. FreeBSD looks in the /etc/host.conf configuration file to find out which method(s) should be used to resolvethe hostnames.A typical host.conf file would look like following:# cat /etc/host.confhostsdnsThis is how a typical system translates host names to IP addresses:1. The system looks for matching host names in the /etc/hosts file. If amatching pattern was found, it will use the returned IP address.2. If the host cannot be resolved using the hosts file, the system then queries theDNS servers as defined in the /etc/resolv.conf configuration file.You can change the order of lines in this file or remove any of them, ifnecessary. For example, if you want to disable DNS lookups and rely onthe /etc/hosts file, you should remove (or comment out) the DNS linein this file.The /etc/hosts file contains a few default entries that are created during systemsetup. A typical host file may look like the following command:# cat /etc/hosts::1 localhost.example.net localhost127.0.0.1 localhost.example.net localhost192.168.0.1 myhost.example.net myhost192.168.0.1 myhost.example.net.You can add your own host to the IP mapping entries to the file or modify existingmappings. It is also recommended that you update this file after changing yourhostname or IP address in order to reflect the correct information.FreeBSD's DNS resolver client uses the /etc/resolv.conf configuration file todetermine which DNS servers should be used and in what order. You can defineas many DNS servers as you require, in this file, and they will be used in the sameorder as configured in the resolv.conf file. As soon as one of the servers returns theanswer to the DNS query, the search will stop.[ 120 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!