Alias ip & hostname

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Alias ip & hostname
# 1  
Old 06-01-2016
Alias ip & hostname

Hello Forum members,

I am new to the Linux administration and i have a question on the below requirement , requirement is as below

Create a new alias-IP & alias-Host name to the existing virtual machine ( RHEL 6.6)

I have created alias-IP and here is the below

Code:
 
eth3      Link encap:Ethernet  HWaddr 00:12:34:A0:56:00
          inet addr:10.1.2.3  Bcast:10.1.2.3  Mask:255.255.255.0
          inet6 addr: ab10::123:45aa:abc1:1200/12 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:123456789 errors:0 dropped:0 overruns:0 frame:0
          TX packets:123456789 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:123456789012 (123.4 GiB)  TX bytes:123456789012 (456.1 GiB)

eth3:1    Link encap:Ethernet  HWaddr 00:12:34:A0:56:00
          inet addr:10.1.2.4  Bcast:10.1.2.3  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:31711983 errors:0 dropped:0 overruns:0 frame:0
          TX packets:31711983 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
       RX bytes:123456789012 (12.4 GiB)  TX bytes:123456789012 (24.1 GiB)

But the users have a request ( they use this values in the script to start the servers and bind them to the IP & PORT ) where in when they SSH with the alias-IP and do

Code:
 hostname -i

it should give 10.1.2.4 but is is giving 10.1.2.3

for alias-Host name i have added the DNS entries but users have the similar requirement there as well

Code:
 hostname -s

It should give them actual host-name or alias-Hostname based on how they login , Can you please help me with this

Last edited by Scrutinizer; 06-02-2016 at 01:15 AM.. Reason: doubt -> question
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Hostname -f hostname: Unknown host

deleted (0 Replies)
Discussion started by: hce
0 Replies

2. Shell Programming and Scripting

Clear command help & alias

Hi Folks, When I type clear on my unix prompt on mac terminal, it prints the help menu of a program instead of cleaning the contents of the screen. Also, I have used the following alias command to setup some shortcuts, but soon after I logout and login, these shortcuts doesn't work. alias... (4 Replies)
Discussion started by: jacobs.smith
4 Replies

3. Emergency UNIX and Linux Support

HP UX - ILO Console hostname different than Machine Hostname...

Hi All, So we added a new HP-UX 11.31 machine. Copied OS via Ignite-UX (DVD)over from this machine called machine_a. It was supposed to be named machine_c. And it is when you log in...however when I'm in the ILO console before logging in, it says: It should say: What gives? And how do... (4 Replies)
Discussion started by: zixzix01
4 Replies

4. UNIX for Dummies Questions & Answers

Changing IP & hostname

I have to do this twice. First, A) change IP address, subnet & default gateway. then a few days later B) change IP address again (same subnet & gateway) & hostname. (why twice? To get the vlan stuff out of the way in advance) what is the best way to do A? can all be done through... (5 Replies)
Discussion started by: LisaS
5 Replies

5. HP-UX

Hostname alias

How to set up hostname alias for HP-UX... (2 Replies)
Discussion started by: RPG
2 Replies

6. UNIX for Dummies Questions & Answers

Solaris - unknown hostname - how can I change hostname?

Hello, I am new to Solaris. I am using stand alone Solaris 10.0 for test/study purpose and connecting to internet via an ADSL modem which has DHCP server. My Solaris is working on VMWare within winXP. My WinXP and Solaris connects to internet by the same ADSL modem via its DHCP at the same... (1 Reply)
Discussion started by: XNOR
1 Replies

7. UNIX for Dummies Questions & Answers

alias for running in background &

Hi all, I am kinda new to this unix environment, and now I get confused to figure out this alias problem. I would like to make my xemacs to run in background every call, and I am trying to do it this way in .bashrc alias e='xemacs &* & ' i also tried e () { xemacs "&*" &} but they are... (0 Replies)
Discussion started by: hfireflyu
0 Replies

8. Solaris

hostname alias

In solaris 9, how do I setup hostname alias, so essentially the machine has two hostnames... (3 Replies)
Discussion started by: csaunders
3 Replies

9. HP-UX

alias & parameters

We just recently moved from a DG-UX (Unix V) to HP 9000 servers running POSIX. I used the c-shell in the DG-UX system mainly because the bourne-shell did not support aliasing. Now in the default posix-shell of HP aliasing is supported. The main difference seams to be that in a c-shell you can pass... (1 Reply)
Discussion started by: vslewis
1 Replies

10. Shell Programming and Scripting

Alias's & Functions - simple question

Having a memory lapse: If I redefine a command using an alias or a function - How do I access the "real" command without specifying an absoulte path: i.e. function man { /usr/bin/man |more } alias ls='/usr/bin/ls -l' How do I specify the ls or man command above without the... (6 Replies)
Discussion started by: kornshellmaven
6 Replies
Login or Register to Ask a Question