( subchee | 2011. 10. 01., szo – 17:49 )

Én a biztonság kedvéért hagyom a networkmanager-nek, hogy beírja a dhcp-től kapott dns szervert a resolv.conf végére.
Létrehoztam egy resolv.conf.head fájlt (az /etc alatt, ofcóz), oda be lehet pakolni pl. a "nameserver 127.0.0.1" és/vagy "nameserver 8.8.8.8", stb bejegyzéseket. Ezután a networkmanager-t rá kell venni, hogy vegye figyelembe a resolv.conf.head (és esetleg .tail) fájlokat, valahogy így:

[root@arch32]# vim /etc/NetworkManager/dispatcher.d/99-resolv.conf_head_and_tail

Beilleszteni ezt:


#!/bin/bash
# 
# /etc/NetworkManager/dispatcher.d/99-resolv.conf-head_and_tail
# Include /etc/resolv.conf.head and /etc/resolv.conf.tail to /etc/resolv.conf
#
# scripts in the /etc/NetworkManager/dispatcher.d/ directory
# are called alphabetically and are passed two parameters:
# $1 is the interface name, and $2 is “up” or “down” as the
# case may be.

resolvconf='/etc/resolv.conf';
cat "$resolvconf"{.head,,.tail} 2>/dev/null > "$resolvconf".tmp
mv -f "$resolvconf".tmp "$resolvconf"

Majd:

[root@arch32]# chmod 0700 /etc/NetworkManager/dispatcher.d/99-resolv.conf_head_and_tail
[root@arch32]# service networkmanager restart #hazudok, mert arch-on ez rc.d restart networkmanager :P

Teszt:

[root@arch32]# cat /etc/resolv.conf
nameserver 127.0.0.1
# Generated by NetworkManager
nameserver 192.168.1.254

Forrás: https://wiki.archlinux.org/index.php/NetworkManager#Configuration