Ubuntu manages local DNS settings by "resolvconf" package and settings could be set in /etc/network/interfaces file.
For example
I have local dns server on 127.0.0.1. And i've plunged in strange behavior with "dns-nameservers" flag.
If i set
But if I put 127.0.0.1 as first nameserver
What i've found here /etc/resolvconf/update.d/libc (this file related to resolvconf package)
SOLUTION:
Used ubuntu 12.04 LTS
For example
# This file describes the network interfaces available on your systemIn detail "man interfaces" or "man resolvconf".
# 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 192.168.122.20
netmask 255.255.255.0
gateway 192.168.122.1
dns-nameservers 127.0.0.1 8.8.8.8
dns-search local.lan cloud.lan
I have local dns server on 127.0.0.1. And i've plunged in strange behavior with "dns-nameservers" flag.
If i set
It works like a charm.dns-nameservers 8.8.8.8 127.0.0.1
cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
nameserver 127.0.0.1
search local.lan cloud.lan
But if I put 127.0.0.1 as first nameserver
dns-nameservers 127.0.0.1 8.8.8.8There is no nameservers after 127.0.0.1 ...
cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)But I want to be able to use local dns as preferable plus other public nameserver.
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
search local.lan cloud.lan
What i've found here /etc/resolvconf/update.d/libc (this file related to resolvconf package)
...
# Set TRUNCATE_NAMESERVER_LIST_AFTER_LOOPBACK_ADDRESS=no
# to allow additional nameserver addresses to be listed in
# resolv.conf after an initial loopback address 127.* or ::1.
...
SOLUTION:
echo "TRUNCATE_NAMESERVER_LIST_AFTER_LOOPBACK_ADDRESS=no" >> /etc/default/resolvconf
Used ubuntu 12.04 LTS
Комментариев нет:
Отправить комментарий