Static DNS dengan DHCP di Linux

Jika menggunakan DHCP (dynamic address), dhcp akan assign nameserver secara otomatis juga ke /etc/resolv.conf.
Adakalanya kita perlu menambahkan entry dns server lainnya, tetapi entry yang kita masukkan secara manual ini akan hilang bila networkingnya kita restart.
Nah bagaimana supaya dhcp client bisa memasukkan custom dns server kita di /etc/resolv.conf ?

Kita perlu mengedit file /etc/dhcp3/dhclient.conf
cari baris berikut :

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

Ubah sebagai berikut :

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

Replace 1.2.3.4 and 1.2.3.5 with the addresses of your DNS servers.

Run

sudo /etc/init.d/networking force-reload

About Ronald Gautama

Abnormal Miscreated

Posted on Desember 4, 2007, in LiNUX, Tutorsial and tagged , , . Bookmark the permalink. 1 Komentar.

  1. om minta ijin lambil tutorialnya ya

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: