LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 07-24-2009, 02:01 AM   #1
adevendra
LQ Newbie
 
Registered: Jul 2009
Location: dallas
Distribution: rhel centos ubuntu
Posts: 6

Rep: Reputation: 0
Arrow hostname resolution locally


I have two IP's configured on same port eth0-169.254.100.10 and eth0:1 - 169.254.100.110.

I would like to assign two hostnames to them say tinku.myhost.com and tinku-secondry.myost.com and two processes using them.

I would like to get 169.254.100.10 when using host tinku.myhost.com and 169.254.100.110 when using hostname tinku-secondry.myhost.com.

Is there a way apart from setting up a local dns server.
 
Old 07-24-2009, 02:08 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
You can enter the resolution in each computers /etc/hosts file

Last edited by Simon Bridge; 07-24-2009 at 10:13 AM.
 
Old 07-24-2009, 02:10 AM   #3
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
add it on your /etc/hosts
ip address1 hostname1
ip address2 hostname2

from where you are accessing these servers you will have to add these entries on each servers /etc/hosts file
 
Old 07-24-2009, 09:58 AM   #4
adevendra
LQ Newbie
 
Registered: Jul 2009
Location: dallas
Distribution: rhel centos ubuntu
Posts: 6

Original Poster
Rep: Reputation: 0
Arrow

Thank you simon and kirukan. I did that b4 posting but didn't help. :-( I am using rhel 4.6

Last edited by adevendra; 07-24-2009 at 10:00 AM.
 
Old 07-24-2009, 10:16 AM   #5
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
what do you mean "didn't work", what is in /etc/hosts and how did you test it?

You have two IPs for the same nic?
There are several ways to do this - which did you use?
 
Old 07-24-2009, 10:52 AM   #6
adevendra
LQ Newbie
 
Registered: Jul 2009
Location: dallas
Distribution: rhel centos ubuntu
Posts: 6

Original Poster
Rep: Reputation: 0
added following in /etc/hosts

169.254.100.10 tinku-myservertinku.myhost.com
169.254.100.110 tinku-secondary.myhost.com

And then restarted network service and ran
$>host tinku-secondary.myhost.com
Host tinku-secondary.myhost.com not found: 3(NXDOMAIN)

I get similar error with host tinku.myhost.com.

When i run hostname i get tinku.myhost.com

Last edited by adevendra; 07-24-2009 at 10:53 AM.
 
Old 07-24-2009, 01:04 PM   #7
Suncoast
Member
 
Registered: Apr 2009
Location: Largo, Florida
Distribution: Slackware
Posts: 208

Rep: Reputation: 35
Quote:
Originally Posted by adevendra View Post
added following in /etc/hosts

169.254.100.10 tinku-myservertinku.myhost.com
169.254.100.110 tinku-secondary.myhost.com

And then restarted network service and ran
$>host tinku-secondary.myhost.com
Host tinku-secondary.myhost.com not found: 3(NXDOMAIN)

I get similar error with host tinku.myhost.com.

When i run hostname i get tinku.myhost.com
Try this
Code:
169.254.100.10      tinku-myservertinku   tinku-myservertinku.myhost.com. 
169.254.100.110     tinku-secondary   tinku-secondary.myhost.com.
Note the dot at the end of the full name.

Last edited by Suncoast; 07-24-2009 at 01:05 PM.
 
Old 07-24-2009, 10:16 PM   #8
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
In addition to Suncoast...

you did not soy how you set up the interface to have two IPs.
you did not provide the rest of the hosts file ... is tinku.myhost.com an alias for loopback?

properly set up, this host should present two IPs to the network. Have you tried altering the hosts file for other hosts on the network? See if you can, thus. ping by hostname?
 
  


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
Hostname Resolution Raakh Linux - Newbie 1 11-28-2007 02:30 PM
locally resolving hostname Hewson Linux - Networking 3 05-16-2007 06:44 PM
Automatic Hostname Resolution douceur Linux - Networking 3 06-21-2005 04:50 AM
Linux Hostname resolution, etc... nex6 Linux - Enterprise 2 12-28-2004 03:28 PM
Hostname resolution not working akela Linux - Networking 0 06-07-2003 01:17 PM

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

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