LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-23-2005, 07:56 AM   #1
moonmoth
Member
 
Registered: Nov 2004
Location: Tallahassee, FL
Distribution: Fedora Core 15
Posts: 95

Rep: Reputation: 17
Can ping by IP address but not by name


Is there any way to associate a name with a dynamic IP address? I have five machines, each of which are assigned dynamic IP addresses by a router which acts as a DHCP server. When they are all running, I can go around to each of them individually and use ifconfig (or ipconfig for Windows machines) and see what the IP address is for each one. From any machine I can ping any other machine, using that IP address.

However, when I try to ping using a hostname rather than the assigned IP address, it doesn't work. I tried assigning each Linux machine a static IP address (which is not the same as any dynamic IP address that is going to be assigned) but it still doesn't work.
 
Old 07-23-2005, 08:30 AM   #2
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,012

Rep: Reputation: 115Reputation: 115
you need to put entries into /etc/hosts for each computer. These names can only be used on the network, not the Internet at large. DHCP can act just like static IP if the lease period is indefinite.
 
Old 07-23-2005, 09:03 AM   #3
moonmoth
Member
 
Registered: Nov 2004
Location: Tallahassee, FL
Distribution: Fedora Core 15
Posts: 95

Original Poster
Rep: Reputation: 17
So then how do I make the lease period indefinite? And does this mean that after everything is shut down, and then booted back up, that each machine will get the exact same IP address assigned by the router as it had before?
 
Old 07-23-2005, 09:39 AM   #4
saman007uk
Member
 
Registered: Dec 2003
Location: ~root
Distribution: Debian
Posts: 364

Rep: Reputation: 33
Quote:
Originally posted by moonmoth
So then how do I make the lease period indefinite? And does this mean that after everything is shut down, and then booted back up, that each machine will get the exact same IP address assigned by the router as it had before?
As long as the router/DHCP server is not rebooted, the machines will have teh exact same IP. You can make the lease time indefinite through your router's configuration.
 
Old 07-23-2005, 09:40 AM   #5
koyi
Member
 
Registered: Jul 2003
Location: Osaka, Japan
Distribution: Arch, Ubuntu
Posts: 421

Rep: Reputation: 31
Usually you should be able to access a router through a web interface to tweak its settings. Perhaps you should read the manual of your router.

And in fact, I have had 5 computers connected to a ADSL modem with a built-in router function. And the lease period is set to 72 hours. But the assigned IP's seem pretty stable to me. They never changed in one year or two as long as I remember.

So you may be OK to get along with it.
Of course it depends on how your router assign IP addresses.

Just for reference.
 
Old 07-23-2005, 09:52 AM   #6
moonmoth
Member
 
Registered: Nov 2004
Location: Tallahassee, FL
Distribution: Fedora Core 15
Posts: 95

Original Poster
Rep: Reputation: 17
RTFM on the router, eh? :-) Well, I had hoped not to have to get involved with the router. My wife has threatened to do terrible things to me if I screw up her internet access (from Windows XP) with my "fooling around" (her term for it) with Linux. Since the Windows machines seem to hum along happily, sharing files and printers, they must have some mechanism for dealing with the dynamic IP addresses. Surely anything Windows can do, Linxux can do better. Can't it?? :-)
 
Old 07-23-2005, 09:55 AM   #7
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 33
a computer may generally request a previousely leased ip address, if it is still avail, the dhcp server most likely will hand it out!
some adsl routers are able to make reservations - this means you assign an ip-address to the requesting mac-address.
 
Old 07-23-2005, 09:56 AM   #8
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,012

Rep: Reputation: 115Reputation: 115
when it comes to networks, definitely. ;-)
It's *theoretically* possible to cut the router out of the network entirely and manage the network with just your Linux computer and a hub or switch (I think).
 
Old 07-23-2005, 10:29 AM   #9
koyi
Member
 
Registered: Jul 2003
Location: Osaka, Japan
Distribution: Arch, Ubuntu
Posts: 421

Rep: Reputation: 31
Since it is just your home network. I think maybe you can just leave it as it is now. If problems(change of IP addresses) show up later(which probably won't), what you have to do is just to edit some /etc/hosts files. Right?
 
Old 07-23-2005, 10:36 AM   #10
moonmoth
Member
 
Registered: Nov 2004
Location: Tallahassee, FL
Distribution: Fedora Core 15
Posts: 95

Original Poster
Rep: Reputation: 17
Well, the fallback is going to be just that when I turn everything on I go around and get the IP address for each machine and edit the /etc/hosts file. Kind of pain in the rear, but guess it is one way to do it. :-(
 
Old 07-23-2005, 11:29 AM   #11
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 33
run a dns server :-)
 
Old 07-23-2005, 01:34 PM   #12
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Your router should allow you the option of assigning a specific IP address to a specific MAC (Ethernet) address. Then all you have to do is make a list of the MAC addresses on your computers and set your router up to assign them the same IP address every time they request one.
 
  


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
can't ping domain name, but can ping ip address dtra Linux - Networking 4 04-03-2013 05:02 PM
Can connect to Internet but can't PING any address 1kyle Linux - Wireless Networking 2 09-06-2005 06:41 PM
can't ping my IP address ust Linux - Distributions 5 04-20-2005 04:55 AM
windows 98 m/c ping to ip address of red hat server but fails to ping hostname ravilohot Linux - Networking 2 09-07-2004 04:57 AM
How do i ping an address in Konsole w/ out an infinite loop?? vbp6us Linux - Networking 1 03-02-2003 04:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:22 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