Ubuntu Server 12.10 static IP i DNS - Tue, Oct 23, 2012
Quantal Quetzal
W Ubuntu Server 12.10 nawet jeśli nie korzystamy z klienta DHCP to po każdym restarcie jest czyszczony plik /etc/resolv.conf
.
Przy statycznej konfiguracji IP wpisy serwerów DNS należy więc umieścić razem z konfiguracją adresu IP w /etc/network/interfaces
.
root@serwer:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 10.0.0.3
network 10.0.0.0
netmask 255.0.0.0
broadcast 10.255.255.255
gateway 10.0.0.1
dns-nameservers 10.0.0.1 10.0.0.2
dns-search domain.local
Przykładowy wpis.
Dużo innych opcji dostępnych na stronie man. Co ciekawe wpisu o DNS tam akurat nie ma.
root@serwer:~# man interfaces