issue with hostname and ip

September 28, 2010 at 13:50:19
Specs: Linux, x86-64
I am dealing with a customer issue in which they have multiple ethernet cards on one host. So they configured one public ip and one private ip and hostnames to each. They updated the same in /etc/hosts file as well. But once you login to the host via public ip and issue command 'hostname' then the output will be hostname of private ip. Kindly let me know if there is any workaround for this.

See More: issue with hostname and ip

Report •

#1
September 28, 2010 at 14:50:45
This may help you. http://jblevins.org/computing/linux...

You can only have one hostname. Hosts file is not how you set the host name it simply allows you to use a simple name instead of an ip address.

Why did it take me over a year to phone in a problem to ATT?


Report •

#2
September 29, 2010 at 15:04:37
Hi jefro, thanks a lot for your recommendation but in that link, it says about configuring hostname as well as domain name for a specific(static) ip. In my case, they have two ips and one among them is private(172.16.x.y) and the domain for each ip is different it seems! The /etc/hosts file is something like:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6

216.45.m.gh abc.def.net abc

172.16.x.yy pqr.stu.com
172.16.x.yz uvw.xyz.com

So actual ip is '216.45.m.gh' but if you start ssh with this ip, it will show 'hostname' output as 'pqr.stu.com'. So does it happen because these ips are in different domain? Please help.


Report •

#3
September 30, 2010 at 13:19:03
DNS seems to be pointing to a FQDN that you don't own.


use nslookup that FQDN.

Why did it take me over a year to phone in a problem to ATT?


Report •

Related Solutions

#4
October 4, 2010 at 14:03:39
I'll check it. Thanks for your help..

Report •

Ask Question