EmbeddedRelated.com
Forums

How to change linux host name and alias name

Started by Like2Learn December 24, 2010
I would like to know how to change my Linux host name and also give it
an alias name. For example, it will have a formal name "EBGP-
@CPE00400501f9a6:", and also an alias such as "FileServer001". Is it
possible?

I think I can use command =91hostname' to change the Linux host name at
runtime, and many other ways to do so. I just don't know how to assign
it an alias name. Any idea?

I also would like to enable file transfer between a windows host and a
linux host, within the same corporate network. By default every
corporate network has DNS server and DHCP server, so I think the
windows host and the Linux host can find each other via either their
host names, or their alias names. For special case, I also want a host
outside of the corporate network to transfer files with another host
inside of the corporate network, so I prefer the file transfer via
HTTP, which is more likely to pass the firewalls with less trouble
than other protocols. Is there any samples codes available for this
solution? Is there any potential risk for this technical solution?

Thank you and Merry Christmas!
On 12/24/2010 4:03 PM, Like2Learn wrote:
> I would like to know how to change my Linux host name and also give it > an alias name. For example, it will have a formal name "EBGP- > @CPE00400501f9a6:", and also an alias such as "FileServer001". Is it > possible? > > I think I can use command �hostname' to change the Linux host name at > runtime, and many other ways to do so. I just don't know how to assign > it an alias name. Any idea?
The startup script in BSD systems effectively runs hostname `cat /etc/myname` This gives the machine *the* hostname specified in /etc/myname. Note that you can tell the name resolver to recognize any of several different names for your machine by tweeks to DNS records, hosts(5), etc. (depending on how the resolver is configured) -- but *the* hostname is still "as above". Of course, if other machines can't see these aliases (e.g., local to your hosts(5) file), then they are only effective locally (this may be desirable *or* undesirable). Likewise, other services have other ways of getting names (e.g., your mailer, web server, etc.) for "this box" which would have to be considered
> I also would like to enable file transfer between a windows host and a > linux host, within the same corporate network. By default every > corporate network has DNS server and DHCP server, so I think the
Neither of these are present "by default". E.g., you could set up a static network that worked perfectly just by distributing a hosts(5) file to each machine.
> windows host and the Linux host can find each other via either their > host names, or their alias names. For special case, I also want a host > outside of the corporate network to transfer files with another host > inside of the corporate network, so I prefer the file transfer via
I find HTTP file transfers often silently crash (i.e., the connection is terminated but the file isn't completely transfered). When this happens in an FTP transfer, it seems I am more aware of the problem (rather than *assuming* a completed transfer == a SUCCESSFUL transfer). But, this could be a consequence of the clients I use in each case.
> HTTP, which is more likely to pass the firewalls with less trouble > than other protocols. Is there any samples codes available for this > solution? Is there any potential risk for this technical solution?
On Dec 24, 5:12=A0pm, D Yuniskis <not.going.to...@seen.com> wrote:
> On 12/24/2010 4:03 PM, Like2Learn wrote: > > > I would like to know how to change my Linux host name and also give it > > an alias name. For example, it will have a formal name "EBGP- > > @CPE00400501f9a6:", and also an alias such as "FileServer001". Is it > > possible? > > > I think I can use command hostname' to change the Linux host name at > > runtime, and many other ways to do so. I just don't know how to assign > > it an alias name. Any idea? > > The startup script in BSD systems effectively runs > =A0 =A0 =A0hostname `cat /etc/myname` > This gives the machine *the* hostname specified in /etc/myname. > > Note that you can tell the name resolver to recognize any > of several different names for your machine by tweeks to > DNS records, hosts(5), etc. (depending on how the resolver > is configured) -- but *the* hostname is still "as above". > > Of course, if other machines can't see these aliases (e.g., > local to your hosts(5) file), then they are only effective > locally (this may be desirable *or* undesirable). > > Likewise, other services have other ways of getting names > (e.g., your mailer, web server, etc.) for "this box" which > would have to be considered > > > I also would like to enable file transfer between a windows host and a > > linux host, within the same corporate network. By default every > > corporate network has DNS server and DHCP server, so I think the > > Neither of these are present "by default". =A0E.g., you could set > up a static network that worked perfectly just by distributing > a hosts(5) file to each machine. > > > windows host and the Linux host can find each other via either their > > host names, or their alias names. For special case, I also want a host > > outside of the corporate network to transfer files with another host > > inside of the corporate network, so I prefer the file transfer via > > I find HTTP file transfers often silently crash (i.e., the connection > is terminated but the file isn't completely transfered). =A0When this > happens in an FTP transfer, it seems I am more aware of the problem > (rather than *assuming* a completed transfer =3D=3D a SUCCESSFUL transfer=
).
> > But, this could be a consequence of the clients I use in each case. > > > > > HTTP, which is more likely to pass the firewalls with less trouble > > than other protocols. Is there any samples codes available for this > > solution? Is there any potential risk for this technical solution?- Hid=
e quoted text -
> > - Show quoted text -
Thank you very much for sharing!