public static String localIP() {
        if (!StringUtils.isEmpty(localIp)) {
            return localIp;
        }
        if (System.getProperties().containsKey(CLIENT_LOCAL_IP_PROPERTY)) {
            return localIp = System.getProperty(CLIENT_LOCAL_IP_PROPERTY, getAddress());
        }
        localIp = getAddress();
        return localIp;
    }
@Test
    void testLocalIpWithPreferHostname() throws Exception {
        InetAddress inetAddress = invokeGetInetAddress();
        String hostname = inetAddress.getHostName();
        System.setProperty("com.alibaba.nacos.client.local.preferHostname", "true");
        assertEquals(hostname, NetUtils.localIP());
    }