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.
Host name aliases
- Nitrofox125
- DBB Admiral
- Posts: 1848
- Joined: Sun Jul 07, 2002 2:01 am
- Location: Colorado Springs, CO, USA
- Contact:
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).
- Iceman
- DBB Habitual Type Killer
- Posts: 4929
- Joined: Thu Apr 20, 2000 2:01 am
- Location: Huntsville, AL. USA
- Contact:
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
% ping Bart-WinXP-In-Pauls-Office@magnacom-inc.com
% ftp Bart-WinXP-In-Pauls-Office@magnacom-inc.com
- CDN_Merlin
- DBB_Master
- Posts: 9781
- Joined: Thu Nov 05, 1998 12:01 pm
- Location: Capital Of Canada
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.
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.
- Iceman
- DBB Habitual Type Killer
- Posts: 4929
- Joined: Thu Apr 20, 2000 2:01 am
- Location: Huntsville, AL. USA
- Contact:
That's a good idea but I don't have access to the server admin account. Looks like its gonna be a shell variable.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.
%!/bin/csh
% setenv BART Bart-WinXP-In-Pauls-Office@magnacom-inc.com
% ping $BART
% ftp $BART
That may not be so bad ...