Defcon1-Header
Tool-BarfreeBSD ArticlesSearch Our SiteHOMEfreeBSD LinksContribute to FreeBSD HelpFreeBSD FilesFreeBSD Script Corner

Setup and Installation of the host file in FreeBSD

 This is one of the problems that users are always having, so, if you are also having a problem understand on how to setup your hosts file in the /etc directory, then this tutorial is for you.
             hosts file.

  You wont get much help with using the man pages, when you first set your FreeBSD up, it will create a hosts file for you with the current IP and the 127.0.0.1 in it, anything else you wish to add you need to add yourself.

Go into the /etc directory, and type  "vi hosts"
 Then create the following lines...

            127.0.0.1    localhost.mymachine.com localhost
 Where "mymachine.com is, put your domain that you wish to use here. This line is probably already listed in the file, and you might just want to edit it.

This line is not included, and is important that you add it.

             127.0.0.1    localhost.mymachine.com.

  We now need to give your machine a nickname if you so desire. But, if we have a Network Interface Card we will assign the IP that we gave it to our name:

            10.0.0.1   chuckie.mymachine.com chuckie
            10.0.0.1   chuckie.mymachine.com.

  The sysinstall in the /stand directory normally creates these for you, but what happens if you didn't have a network card when you installed FreeBSD ?  If so, do the below example :

           127.0.0.1    devil.mycomputer.com devil
           127.0.0.1    devil.mycomputer.com.

 If you have other machines on your network, and you want to add them, this is where we would add them at, for each machine add a new number, for example 10.0.0.x :

            10.0.0.2    fbsd.mycomputer.com fbsd
            10.0.0.2    fbsd.mycomputer.com.

 This will show you what this file should now look like :

            127.0.0.1    localhost.freebsdzine.org localhost
            127.0.0.1    localhost.freebsdzine.org.
            127.0.0.1    devil.mycomputer.com devil
            127.0.0.1    devil.mycomputer.com.
            10.0.0.1     chuckie.mymachine.com chuckie
            10.0.0.1     chuckie.mymachine.com.
            10.0.0.2     fbsd.mycomputer.com fbsd.
            10.0.0.2     fbsd.mycomputer.com.

  After editing our hosts file, we can then go edit /etc/host.conf. We want to check the hosts file before we try named, so we want to have hosts before bind like so:

GhostRdr

© 1997 - 20013 Defcon1, www.defcon1.org , Copyrights for all materials on this web site are held by the individual authors, artists, photographers or creators. Materials may not be reproduced or otherwise distributed without permission of www.defcon1.org and the content's original author.

Defcon1-Header2
Tool-Bar-2Defcon1  Webmail