Skip to content
October 29, 2007 / windperson

又是個浪費1個多小時才解決的白痴問題…而且是發生在自以為聰明的Ubuntu Linux上

一直都是用VMware來跑linux的,最近裝完Ubuntu Linux 7.10版之後發現,每次開機網路的dns設定都會被改回成vmware所設定的預設值,由於在VMWare裡面跑的Virtual Machine我都是設定成使用VMware提供的虛擬NAT network,在M$的Windows系列OS裡面dhcp和dns可以分開來做不同的設定,而恰好"很聰明又自動"的Ubuntu Linux則是dhcp client在向外做dhcp request的時候就連dns server(在linux的世界裡面常常直接叫nameserver)也一併作呼叫並且更新了,所以每次Virtual Machine重開機原本手動設定好的dns設定檔resolv.conf就又都自動被改掉了。斜線

後來終於在網路上找到這個網頁:http://ubuntuforums.org/showpost.php?p=1410184&postcount=3
所以解決方法就是把提供設定資訊給Ubuntu Linux的dhcp client的設定檔dhclient.conf的內容改掉,在/etc/dhcp3/dhclient.conf的檔案內容裡面有個

request subnet-mask, broadcast-address, time-offset, routers,
        domain-name, domain-name-servers, host-name,
        netbios-name-servers, netbios-scope;

把那個domain-name-servers,刪掉,再把dns設定檔/etc/resolv.conf改回成自己要的樣子,就這樣,一切OK。

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: