Page 1 of 1
Host name aliases
Posted: Fri Jul 15, 2005 12:33 pm
by Iceman
Anyone know a way (in Linux) to setup host name aliases without knowing the IP address of the host? I know that in the /etc/hosts file I can equate any number of aliases to a given IP address but I don't know the IP of the node I want to alias.
I am using an FC2 installation and tapping onto a M$ Windows network. I know the name of the node I want to hit but it is so long that it's a pain in the @$$ to type it every time I want to FTP to it.
Posted: Fri Jul 15, 2005 12:38 pm
by fliptw
you can't get the IP of this host you want to connect to, is it one of those virtual host setups?
Posted: Fri Jul 15, 2005 4:18 pm
by Nitrofox125
Can you just set the 'really long name' to be the 'IP address' in the hosts file and use that? Or, set something up in ~/.login or ~/.profile (dunno which it is for your version) that sets your short name to the long name for you as a variable, kinda like path? (I don't know if that's possible, just an idea).
Posted: Mon Jul 18, 2005 7:15 pm
by Iceman
The IP address changes (DHCP) so I would have to look it up quite often. The name of the node is "
Bart-WinXP-In-Pauls-Office@magnacom-inc.com" ... duh ... so much for using a descriptive name when I set it up. Anyhow, re-typing that name over and over again is a pain in the arse. Imagine this ...
% ping
Bart-WinXP-In-Pauls-Office@magnacom-inc.com
% ftp
Bart-WinXP-In-Pauls-Office@magnacom-inc.com
Posted: Mon Jul 18, 2005 7:42 pm
by CDN_Merlin
You would need some type of program like 'no-ip" for windows that would translate the PC's IP to a given name. Don't know of any for Linux.
Posted: Mon Jul 18, 2005 7:57 pm
by fliptw
store it as a shell varible.
Posted: Mon Jul 18, 2005 9:18 pm
by DCrazy
Well you could always run BIND on the machine, define an alias for your big long name, and configure it to refer all your other requests to the network's DNS server, but that would be a bit excessive.
In fact, if you have access to the DNS server that's already running on your network, why not add an alias right on that? That's a lot cleaner than storing the big long name in a shell variable.
Posted: Mon Jul 18, 2005 9:30 pm
by Iceman
DCrazy wrote:In fact, if you have access to the DNS server that's already running on your network, why not add an alias right on that? That's a lot cleaner than storing the big long name in a shell variable.
That's a good idea but I don't have access to the server admin account. Looks like its gonna be a shell variable.
%!/bin/csh
% setenv BART
Bart-WinXP-In-Pauls-Office@magnacom-inc.com
% ping $BART
% ftp $BART
That may not be so bad ...