This content has been marked as final.
Show 1 reply
-
1. Re: Runtime domain name determination
adrian.brock Mar 27, 2002 10:43 AM (in response to macnade)Since this is the JMX forum, you can get the
MBean Server's default domain using the
getDefaultDomain() method.
However, I think you mean the domain name of the server.
Start with
InetAddress local = InetAddress.getLocalHost();
Then you have two options
local.getHostName();
or
local.getCanoncialHostName();
The second method is potentially blocking because
it can access a dns.
Regards,
Adrian