Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / Unix-системы [игнор отключен] [закрыт для гостей] / linux suse + java.net.InetAddress.getLocalHost() / 1 сообщений из 1, страница 1 из 1
11.10.2010, 17:53
    #36893224
Igor-65
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
linux suse + java.net.InetAddress.getLocalHost()
Пробема: на всех рабочих местах (sun Solaris, Windows, RedHat linux) метод java.net.InetAddress.getLocalHost() возвращает адрес хоста.
Но столкнулся с тем, что на компе, где стоит linux suse v11 java.net.InetAddress.getLocalHost() возвращает 127.0.0.2 (В принципе, так и прописано в /etc/hosts).

Дело в том, что, видимо, данный метод используется при создании объектов типа UnicastRemoteObject.

Вопрос: Можно ли как-то заставить suse + java.net.InetAddress.getLocalHost() отдавать правильный (внешний) адрес без изменения /etc/hosts ?
- владелец компа боится трогать именно /etc/hosts
- я читал, что мапирование 127.0.0.2 на имя хоста может восстановиться само:

http://www.filibeto.org/sun/lib/nonsun/oracle/10.2.0.1.0/B19306_01/relnotes.102/b15659.pdf
5.11 Mapping of 127.0.0.2 to the Local Hostname
By default, the hostname of a machine is mapped to the IP address 127.0.0.2 through
an entry in the /etc/hosts similar to the following on SUSE Linux Enterprise Server
10 and SUSE Linux Enterprise Server 11:
127.0.0.2 test test.example.com
YaST does this to provide compatibility with earlier versions of the applications that
had problems running on desktops with dynamically assigned hostnames from DHCP.
This mapping may cause certain Oracle networking libraries to encounter errors when
they attempt to resolve the hostname of the machine. To avoid these problems, the
entry should be removed from the /etc/hosts file. Note that several network related
YaST utilities may add this entry back to the file.
...
Рейтинг: 0 / 0
Форумы / Unix-системы [игнор отключен] [закрыт для гостей] / linux suse + java.net.InetAddress.getLocalHost() / 1 сообщений из 1, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]