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 12-02-2005, 08:54 AM   #1
a_ayarov
LQ Newbie
 
Registered: Dec 2003
Distribution: Ubuntu 5.10 Breezy Badger
Posts: 3

Rep: Reputation: 0
two NIC's with different hostnames, but hostname() returns only one hostname


Hi there,

Here is the situation, I have a server with two NIC's with two hostnames on them

hostname IP NIC

dgrid2 | 141.12.12.141 | eth0
dgrid2-2 | 141.12.12.142 | eth1


the problem is that when I for example ssh into dgrid2-2 and then initiate
$hostname

i get

dgrid2-2

BUT when i ssh into dgrid2 (without any problems) and
$hostname

i get the same

dgrid2-2

I am not sure what other info/files you need in order to get the whole picture but I will provide them by request.
Any info or suggestion will be appreciated thanks in advance

Last edited by a_ayarov; 12-02-2005 at 08:58 AM.
 
Old 12-03-2005, 06:48 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Your system has only one REAL host name. Your NICs can have different VIRTUAL names for the host.

The "hostname" command always returns the REAL hostname so doesn't care how you got to the host (eth0, eth1, ppp0, console, dumb terminal, teleportation etc...)
 
Old 12-11-2005, 06:54 PM   #3
a_ayarov
LQ Newbie
 
Registered: Dec 2003
Distribution: Ubuntu 5.10 Breezy Badger
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks a bunch,

btw sorry for the late reply
 
  


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
"hostname -i" returns 0.0.19.196 fivezerosixzero Linux - General 4 08-27-2004 09:01 PM
hostnames thenewguy05 Linux - Networking 1 07-12-2004 05:08 PM
cannot ping hostnames joadoor Linux - Networking 21 06-10-2003 10:12 AM
hostname command vs. $HOSTNAME env. variable Silly22 Linux - Networking 2 03-29-2002 05:01 PM
Hostnames glj Linux - Networking 3 02-12-2002 10:04 AM

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

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