[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Кэширующий сервак DNS - dnsmasq. Как в автомате добавить "nameserver 127.0.0.1" в начало файла /etc/resolv.conf ?



On Wed, Mar 16, 2011 at 08:32:28AM +0500, Victor P wrote:
> 15 марта 2011 г. 13:52 пользователь Stanislav Maslovski <
> stanislav.maslovski@gmail.com> написал:
> 
>      В описании интерфейсов в /etc/network/interfaces указать адреса
>     DNS-серверов провайдера (т.е., вписывать туда 127.0.0.1 не надо).
> 
>     Пример c OpenDNS:
> 
>     iface eth0 inet static
>            address 192.168.1.2
>            netmask 255.255.255.0
>            gateway 192.168.1.1
>            dns-nameservers 208.67.222.222 208.67.220.220
> 
>     --
>     Stanislav
> 
>  resov.conf <- nameserver 127.0.0.1
> /etc/network/interfaces <- dns-nameservers 127.0.0.1

Нравится ручками делать то, что resolvconf делает автоматически - да
пожалуйста, чем бы дитя не тешилось…

> зачем назначать интерфейсу внешний DNS если поднят свой? Смысл тогда было его
> поднимать?

Читать умеешь? Что-то я сомневаюсь, так как мою рекомендацию установить
resolvconv ты проскипал.

aptitude install resolvconf
man resolvconf

    … resolvconf is run by hook scripts attached to network interface
    configurers such as pppd(8) (for ppp interfaces), to DHCP clients
    such as dhclient(8), to ifup(8) and ifdown, and to DNS caches such
    as dnsmasq(8) (for the loopback interface).  These hook scripts
    furnish resolvconf with information about nameservers …

    … the ifup(8) program can be used to configure network interfaces
    according to settings in /etc/network/interfaces(5).  To make ifup
    publish nameserver information to resolvconf when it configures an
    interface, add dns- lines to the relevant iface stanza in
    /etc/net‐ work/interfaces.  To add nameserver addresses add a line
    beginning with dns-nameservers.

           dns-nameservers 11.22.33.44 55.66.77.88
    
    … nameserver information provided to resolvconf is stored for use
    by subscribers to resolv‐ conf's notification service.
    Subscribers that need to know when nameserver information has
    changed should install a script in /etc/resolvconf/update.d/ (...
    or in /etc/resolv‐ conf/update-libc.d/: see below).  For example,
    DNS caches such as dnsmasq(8) and pdnsd(8) subscribe to the
    notification service so that they know whither to forward queries.

> снесите NetworkManager вообще - ничего хорошего от его работы нет.

Конкретно у меня его и не было никогда.

-- 
Stanislav


Reply to: