My Oracle Support Banner

[Java SE] Does InetAddress.getLocalHost Require Access to /etc/hosts? (Doc ID 2327419.1)

Last updated on APRIL 14, 2025

Applies to:

Java SE JDK and JRE - Version 8 to 9
Generic Linux
Generic UNIX

Goal

Is read access to the /etc/hosts file on a Linux or Unix system needed by the InetAddress.getLocalHost() method?
 

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.