LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-24-2004, 05:50 PM   #1
jimbo
LQ Newbie
 
Registered: Feb 2004
Distribution: RH9
Posts: 10

Rep: Reputation: 0
IP Address for /etc/hosts when using DHCP


I am trying to set up NFS on my home net work, 1 desktop 1 laptop both running RH9. My router is using DHCS. Both machines are now named localhost. I want to change names using hostname and /etc/hosts. What IP addresses should I use in /etc/hosts since the addresses change. There is also a windows machine getting an address from the router. Samba is running OK there.
 
Old 03-24-2004, 06:32 PM   #2
AutOPSY
Member
 
Registered: Mar 2004
Location: US
Distribution: Redhat 9 - Linux 2.6.3
Posts: 836

Rep: Reputation: 31
you should be able to add a line in the hosts file like
192.168.1.109 boscomputer bobscomputer.localdomain

for lan resolution.
 
Old 03-25-2004, 02:47 PM   #3
pingswept
Member
 
Registered: May 2003
Location: Cambridge, MA
Distribution: SuSE, RedHat, and OpenBSD
Posts: 116

Rep: Reputation: 15
To be clear:

Pick anything of the form 192.168.1.xxx, where xxx is a number between 1 and 255 that isn't already in use. Your router is probably 192.168.1.1, and it probably starts allocating dynamic IPs at 192.168.1.100 and counts up (you can probably check this in its settings page).
 
Old 03-25-2004, 11:57 PM   #4
jimbo
LQ Newbie
 
Registered: Feb 2004
Distribution: RH9
Posts: 10

Original Poster
Rep: Reputation: 0
OK,

Thanks, that helps. Can I assume that any IP address within my router's range is OK? Or should I pick numbers which are unlikely to be assigned? ie my DHCP server is using
192.168.0.100 thru 192.168.0.199. Typically it assigns starting at the lowest number in the range and continues sequentially. Do I pick high numbers, or is it OK to use a number that is assigned to another host?

Thanks,


Last edited by jimbo; 03-26-2004 at 01:30 AM.
 
Old 03-27-2004, 02:31 PM   #5
ugge
Senior Member
 
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028

Rep: Reputation: 45
I would suggest using static IP addresses. Just because your router handles DHCP doesn't mean that you have to use it. The /etc/hosts are by design a static solution.
Your problem would be solved right away.

If you would like to still use DHCP then you would have to set up DDNS (Dynamic DNS) along side your DHCP server. That might not work with a home router.

The solution above might work, but it may stop work anytime.
 
Old 03-27-2004, 06:59 PM   #6
jimbo
LQ Newbie
 
Registered: Feb 2004
Distribution: RH9
Posts: 10

Original Poster
Rep: Reputation: 0
jimbo

Yes, that sounds like the simplest solution. I was so locked in to solving a problem that I couldn't see that I could just side step the whole issue. Sort of like the adage, "can't see the forest for the trees". Thanks for the insight.

jimbo

Last edited by jimbo; 03-27-2004 at 07:01 PM.
 
  


Reply



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
dhcp no ip address and netmask dont match route address pengy666 Linux - Wireless Networking 1 05-08-2005 09:33 AM
DHCP Server MAC Address found, IP address not assigned wmburke Linux - Wireless Networking 17 11-17-2004 10:33 AM
block ip address/hosts sohmc Linux - Security 3 09-19-2004 11:13 AM
How to configure DHCP client at server /etc/hosts ? x2000koh Linux - Networking 1 08-06-2003 03:02 AM
/etc/hosts (or: getting DHCP clients) billlee Linux - Networking 5 06-09-2003 03:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:14 AM.

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