LinuxQuestions.org
Help answer threads with 0 replies.
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 06-28-2010, 01:38 PM   #1
ksdmnv
LQ Newbie
 
Registered: Jun 2010
Posts: 11

Rep: Reputation: 0
How to resolve hostnames on DHCP home network


Hi,

(although I'm running Solaris, I've posted here as I expect Solaris/LINUX is irrelevant) - more of a general network Q.


I have a PC running Solaris 10 (hostname MARKUNIX) and a laptop running WinXP (hostname MARK-LAPTOP).

Both are connected to broadband via a router. IP addresses for each are determined via DHCP (192.168.1.nn) and I do not leave either on, 24x7.

I am running Oracle on MARKUNIX and want to be able to refer to it by hostname when using Oracle tools on my laptop.

Each machine can ping each other ok by ip address and curiously the Solaris PC can ping MARK-LAPTOP (I'm not sure how it resolves that?) - importantly the laptop cannot ping MARKUNIX.

Now I could add MARKUNIX to my laptops hosts file but that would mean changing the file each time I boot up as the ip address for MARKUNIX will keep changing (DHCP).

Is there a way to refer to MARKUNIX without having to keep changing ip addresses and use DHCP? As I understand it the 192.168 address is private and is not really the 'real' ip address and as such can be manipulated(fixed?) even whilst using DHCP?

Am I right in thinking that a static ip from my broadband supplier is the ip of my connection (router) and I'll still have the same private network referencing issues?

What I've covered above pretty much is the extent of my knowledge of networking so bear that in mind please ;-)

Any help greatly appreciated.

cheers
 
Old 06-28-2010, 02:12 PM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
Some dhcpd servers support setting dns information for a host, but I'm unsure how portable it is... you can also look at using dyndns typical of local product and automate the process to some degree.
 
Old 06-28-2010, 03:43 PM   #3
tsg
Member
 
Registered: Mar 2008
Posts: 155

Rep: Reputation: 30
Some routers will allow you to define static IP addresses assigned through DHCP. You'll still get the DNS etc. settings through DHCP but each machine will get the same IP address every time.

Many routers do DNS for the private network by using the Windows machine name (probably why MARK-LAPTOP works). On Linux you can run Samba to provide it to the router. I'm not sure about Solaris.
 
Old 06-28-2010, 07:16 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,973

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
You need to set up wins server I'd think.

The other way would be to make a dns entry for that on a local server. (again I'm thinking)

Might be more simple to assign the leases forever so that each time it gets the same IP address.

Ping is getting blocked by default more and more. Not a good test anymore.

Last edited by jefro; 06-28-2010 at 07:17 PM.
 
Old 06-28-2010, 07:59 PM   #5
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
My standard solution is to run a DNS server on a linux server (bind9) and bind IP addresses to names. Then I also run a DHCP server on the same linux box, and in the dhcpd.conf I use stanzas like:

Code:
host donald_pc {
  hardware ethernet 00:0a:5e:42:99:81;
  fixed-address donald_pc.megaline.com;
}
By stating the MAC address I make sure that this PC always gets the correct IP address. The IP address is defined in the DNS file for this domain. There is only one place (two files) where I have to define IP address against name, and that is in the DNS files.

You could also make a shortcut to this method by defining IP addresses bound to MAC addresses in your DHCP server. Even broadband routers can do that now. Then you can either address a host by its (constant now) IP address or use an entry in the hosts file.

jlinkels
 
  


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
Home network, hostnames, IP addresses, dynamic dchp MajorDill Linux - Newbie 1 10-15-2009 06:03 PM
resolve machine name over home network dp_miller Linux - Networking 5 05-29-2009 05:21 PM
Can't resolve hostnames Emma77 Debian 12 08-02-2006 04:31 PM
FC4: cannot resolve hostnames on local network pyepye Linux - Networking 12 04-05-2006 12:29 PM
resolve hostnames zero_kewl Linux - General 5 09-01-2003 04:00 AM

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

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