PDA

View Full Version : problem with hostname



albumns
15-Feb-2012, 21:44
Hello:
I've set my hostname as: ABC and domainname: EDF by YAST
I found that when I use command 'hostname' in terminal, it said:

ABC

But I expect it should be ABC.EDF which also display the domain name....

Does anybody how to do this?

THX

malcolmlewis
15-Feb-2012, 22:26
Hello:
I've set my hostname as: ABC and domainname: EDF by YAST
I found that when I use command 'hostname' in terminal, it said:

ABC

But I expect it should be ABC.EDF which also display the domain
name....

Does anybody how to do this?

THX



Hi
Use hostname -f (hostname --help ;) )

--
Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 3.0.13-0.19-default
up 1 day 22:37, 3 users, load average: 0.00, 0.01, 0.05
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

mikewillis
15-Feb-2012, 22:28
But I expect it should be ABC.EDF which also display the domain name....


I would expect it to say ABC not ABC.EDF. If you want the hostname command to show the domain as well use

$ hostname -f

For more info see

$ hostname --help
$ man hostname

albumns
16-Feb-2012, 06:42
Thank you very much for your kind reply.
but my academic software was licensed to a machine named "ABC.DEF" which showned in SLES 10. When I update the system into 11, my academic software claimed my machine name is "ABC" not "ABC.DEF" and the license server cannot be started...

THX


Hi
Use hostname -f (hostname --help ;) )

--
Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 3.0.13-0.19-default
up 1 day 22:37, 3 users, load average: 0.00, 0.01, 0.05
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

albumns
16-Feb-2012, 06:52
I would expect it to say ABC not ABC.EDF. If you want the hostname command to show the domain as well use

$ hostname -f

For more info see

$ hostname --help
$ man hostname

in fact, it doesn't work with command: hostname -f

it said in terminal:

hostname: Unknown host

malcolmlewis
16-Feb-2012, 07:10
Thank you very much for your kind reply.
but my academic software was licensed to a machine named "ABC.DEF"
which showned in SLES 10. When I update the system into 11, my academic
software claimed my machine name is "ABC" not "ABC.DEF" and the license
server cannot be started...

THX

malcolmlewis;2416 Wrote:
> Hi
> Use hostname -f (hostname --help ;) )
>


Hi
So what about the other hostname options any output? Can you check it's
set;


fgrep -r "ABC" /etc/*

Where ABC is your hostname, also swap for your domain name.

--
Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 3.0.13-0.19-default
up 2:10, 3 users, load average: 0.06, 0.05, 0.05
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

smflood
20-Feb-2012, 14:05
On 16/02/2012 05:54, albumns wrote:

> in fact, it doesn't work with command: hostname -f
>
> it said in terminal:
>
> hostname: Unknown host

I can confirm on SLES11 SP1 that hostname -f a) works, and b) works
correctly _provided_ /etc/hosts has the correct entry in the form

IP-Address Full-Qualified-Hostname Short-Hostname

With a default install (plus OES11) the entry for my host was

IP-Address Short-Hostname Short-Hostname

so whilst hostname correctly returned Short-Hostname, hostname -f also
returned Short-Hostname whilst hostname -d returned nothing. Editing the
/etc/hosts entry to append domain to first Short-HostName value "fixed"
the output of both hostname -f and hostname -d.

HTH.
--
Simon
Novell/SUSE/NetIQ Knowledge Partner

------------------------------------------------------------------------
Do you work with Novell technologies at a university, college or school?
If so, your campus could benefit from joining the Novell Technology
Transfer Partner (TTP) program. See novell.com/ttp for more details.
------------------------------------------------------------------------