Under Linux I don't get the FQDN for my machine. Primarily because when I set
the machine up i did not specify it's hostname as its FQDN (which I don't think
it should be). Java should have better access to the local machine's various
names, but then again Java should have lots of better things.
If you get this one figured out please let me know.
--jason
On 12-Nov-98 Mark Hofmann wrote:
> Hi all,
>
> I've posted that question a few days ago to java.lang.programmer
> but got no response :-(
> But, since this problem is really bugging me, and there might be some
> people in this list that run there progs under NT and Linux, just as me,
> I hope to find a solution here.
> Anyway, here is the problem, easy and simple ....
>
> when I use
> String localhostname=(InetAddress.getLocalHost()).getHostName();
> under Linux I get the fully qualified hostname, under NT just the local
> hostname, eg. host instead of host.my.domain.com
>
> Our admin says that its an NT feature/problem (you never know) because it
> stores both names separately and returns usually only the local hostname.
>
> Is there a workaround for that, so I can get the fully qualyfied hostname or
> do I just have to live with that? Or even better is our system misconfigured
> and I can tell our admin that he's wrong (which is always fun ;-) )
>
> Thanks in advance
>
> Mark
>
>
>
> --
> M a r k H o f m a n n
> Department of Computer Science
> University of Stellenbosch / South Africa
> phone: +27-82-7449880