Interface NetworkParams
- All Known Implementing Classes:
AbstractNetworkParams, LinuxNetworkParams, LinuxNetworkParamsNF, OpenBsdNetworkParams
Provides network parameters of the running operating system, including the hostname, domain name, DNS server
addresses, and default gateways for IPv4 and IPv6.
The hostname (getHostName()) is the local machine name. The domain name (getDomainName()) is the
DNS domain suffix. DNS servers (getDnsServers()) are the configured name resolution servers. The default
gateways (getIpv4DefaultGateway(), getIpv6DefaultGateway()) are the routing destinations for
0.0.0.0/0 and ::/0 respectively, and return an empty string if not defined.
-
Method Summary
Modifier and TypeMethodDescriptionString[]Gets the DNS Servers configured for this machine.Gets the Domain Name of the machine executing OSHI.Gets the HostName of the machine executing OSHI.Gets the default gateway(routing destination for 0.0.0.0/0) for IPv4 connections.Gets default gateway(routing destination for ::/0) for IPv6 connections.
-
Method Details
-
getHostName
-
getDomainName
-
getDnsServers
-
getIpv4DefaultGateway
String getIpv4DefaultGateway()Gets the default gateway(routing destination for 0.0.0.0/0) for IPv4 connections.- Returns:
- default gateway for IPv4, or empty string if not defined.
-
getIpv6DefaultGateway
String getIpv6DefaultGateway()Gets default gateway(routing destination for ::/0) for IPv6 connections.- Returns:
- default gateway for IPv6, or empty string if not defined.
-