ubuntu server 12.10 set dnsnameserver config by interface av

回覆文章
tony
文章: 585
註冊時間: 2012-02-26, 07:04
聯繫:

ubuntu server 12.10 set dnsnameserver config by interface av

未閱讀文章 tony »

It’s probably better to have your DNS server be able to resolve ‘puppet’ to the right address, and have your DHCP server hand out the DNS information, or if you have static IP addresses, something like this.

iface eth0 inet static
address 192.168.3.3
netmask 255.255.255.0
gateway 192.168.3.1
dns-search example.com
dns-nameservers 192.168.3.45 192.168.8.10

But if you do want to do it via the resolv.conf file, wou will want to edit

/etc/resolvconf/resolv.conf.d/head
In that file, after the header, put in your info like you would in resolv.conf

nameserver 192.168.1.XXX

Then restart resolvconf

sudo resolvconf -u

建議:

Ubuntu 12.10 DNS 設定盡量在 /etc/network/interfaces 設定檔中設定「dns-nameservers」參數值(可用空白區隔多個IP位址)。

如果想由 nameserver=x.x.x.x 的方式設定DNS,可以直接在「/etc/resolvconf/resolv.conf.d/head」寫入之後需重新啟動或更新 resolvconf 。
回覆文章

誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 1 位訪客