LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 06-05-2009, 03:06 PM   #1
charlie_lab
Member
 
Registered: Nov 2006
Posts: 255

Rep: Reputation: 30
hosts question


Hello,

I try to make the hostfile working.
On my system the router has dhcp so my computer gets a ip-number.
Do i have to type a ip-number in the host-file or must i do something else to make this work.

Roelof
 
Old 06-05-2009, 06:14 PM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
charlie_lab:

From your question I guess that you are trying to make the machine's hostname appear in the /etc/hosts file?

Hosts files aren't normally used for dynamic IP addresses, as they can become out of date, and "localhost" is always mapped to the local machine (albeit through the loopback interface not through the external network interface). Another option is to use a DNS server (http://www.tldp.org/HOWTO/DNS-HOWTO.html).

It is still possible to update the hosts file from DHCP, but I couldn't find any examples on line, suggesting that it's a rather rare thing to do.

The software that gets your DHCP address from the router is called a DHCP client, and it needs to be set up to update the hosts file when your IP address changes. On Ubuntu (for example), you can add a script to the directory /etc/dhcp3/dhclient-exit-hooks.d/, and dhclient will run that script when your IP address changes.

Hope that helps,

—Robert J Lee
 
Old 06-06-2009, 05:49 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Now that you finished LFS, you probably want to look at BLFS.

DHCP client or daemon are both described (part of IV. Basic Networking).

BTW: LFS and BLFS differ in the way they should be approached. LFS is straight forward: Start at page 1 and work your way to the end. BLFS on the other hand is a collection of software, you decide which you install and which you don't. If you want to install DHCP client, take a look at that chapter, it explains how to install, shows (if any) dependencies/configuration.

If at all possible use the BLFS documentation, other sources tend to set up things differently (primarily the location of files).

Hope this helps.
 
Old 06-06-2009, 07:43 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi again,

You might also want to take a look at the following 2 chapters, those will give you an idea about what BLFS covers (and what not):

Which Sections of the Book Do I Want?
Going Beyond BLFS

The second link gives you some pointers for packages that are not covered in the BLFS book.
 
Old 06-06-2009, 08:49 AM   #5
charlie_lab
Member
 
Registered: Nov 2006
Posts: 255

Original Poster
Rep: Reputation: 30
Oke,

Both , thank you.
I have to read a lot but that's not a problem.
Have a nice weekend.

Roelof
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/etc/hosts question n00bDanimal Other *NIX 3 05-22-2007 05:55 PM
[SOLVED] question about hosts.allow/hosts.deny Wim Sturkenboom Linux - Security 9 05-30-2006 02:33 AM
/etc/hosts and hosts.deny question ilan1 Linux - Networking 4 03-04-2006 06:28 PM
hosts.allow & hosts.deny question... jonc Linux - Security 9 03-05-2005 10:41 PM
/etc/hosts question viv Linux - Newbie 1 04-17-2002 06:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 10:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration