LINUX.ORG.RU

Странный глюк hostname.

 , ,


0

1

Вызов 'hostname -f' приводит к зависанию и выводу 'host name lookup failure' через некоторое время. Из-за этого запуск X через startx проходит медленно. Контент /etc/hostname: «rmbp». В /etc/hosts ничего необычного. Все остальные хосты резолвятся нормально. Дистрибутив: Gentoo.

/etc/nsswitch.conf:

# /etc/nsswitch.conf:
# $Header: /var/cvsroot/gentoo/src/patchsets/glibc/extra/etc/nsswitch.conf,v 1.1 2006/09$

passwd:      compat
shadow:      compat
group:       compat

# passwd:    db files nis
# shadow:    db files nis
# group:     db files nis

hosts:       files dns
networks:    files dns

services:    db files
protocols:   db files
rpc:         db files
ethers:      db files
netmasks:    files
netgroup:    files
bootparams:  files

automount:   files
aliases:     files
/etc/hosts:
# /etc/hosts: Local Host Database
#
# This file describes a number of aliases-to-address mappings for the for
# local hosts that share this file.
#
# In the presence of the domain name service or NIS, this file may not be
# consulted at all; see /etc/host.conf for the resolution order.
#

# IPv4 and IPv6 localhost aliases
127.0.0.1       localhost
::1             localhost

#
# Imaginary network.
#10.0.0.2               myname
#10.0.0.3               myfriend
#
# According to RFC 1918, you can use the following IP networks for private
# nets which will never be connected to the Internet:
#
#       10.0.0.0        -   10.255.255.255
#       172.16.0.0      -   172.31.255.255
#       192.168.0.0     -   192.168.255.255
#
# In case you want to be able to connect directly to the Internet (i.e. not
# behind a NAT, ADSL router, etc...), you need real official assigned
# numbers.  Do not try to invent your own network numbers but instead get one
# from your network provider (if any) or from your regional registry (ARIN,
# APNIC, LACNIC, RIPE NCC, or AfriNIC.)
#

# Router.
192.168.1.254 router.local
/etc/conf.d/net:
modules_wlp4s0="wpa_supplicant"
config_wlp4s0="dhcp"
dns_domain_lo="homenet"

Deleted

Последнее исправление: romeo250501 (всего исправлений: 1)

В /etc/hosts ничего необычного.

Покажи /etc/hosts, /etc/resolv.conf, /etc/conf.d/net и /etc/nsswitch.conf

Pinkbyte ★★★★★
()

Так добавь адрес для хостнейма в /etc/hosts или юзай нормальный fqdn

invokercd ★★★★
()

Информация по тому, как получает имя хоста команда hostname, довольно скудная, и на самом деле файл /etc/{HOSTNAME,hostname} имеет к этой команде несколько косвенное отношение.

По факту система делает reverse DNS lookup по IP адресу узла, чтобы узнать его имя. Если DNS ничего не находит, то возникает такая задержка. Чтобы этого избежать, можно указать имя хоста в /etc/hosts, тогда до DNS дело не дойдет, имя узла будет взято из этого файла. Собственно, я так понимаю, что это наименее костыльный способ указания имени хоста (помимо записи в DNS сервере). Единственная тонкость: иногда привязка к 127.0.0.1 не работает, тогда надо IP адрес какого-то физического интерфейса указывать.

Kiborg ★★★
()

Всем спасибо! Решил проблему сам.

Deleted
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.