Cara Setting resolv.conf Permanen di Ubuntu - Kelasinong

Monday, March 29, 2021

Cara Setting resolv.conf Permanen di Ubuntu

File /etc/resolv.conf adalah file yang berisi DNS resolver atau IP address dari DNS server (nameserver) yang
berfungsi untuk mentranslasi dari nama domain menjadi IP address.
Untuk mengatasi masalah di atas adalah dengan cara menggunakan resolvconf service.
Install paket resolvconf.

sudo apt install resolvconf	
Kemudian aktifkan dan jalankan resolvconf service.

sudo systemctl enable resolvconf
sudo systemctl start resolvconf
sudo systemctl status resolvconf
Hasilnya seperti di bawah ini.

● resolvconf.service - Nameserver information manager
     Loaded: loaded (/lib/systemd/system/resolvconf.service; enabled; vendor preset: enabled)
     Active: active (exited) since Sun 2020-07-26 18:08:17 WIB; 14h ago
       Docs: man:resolvconf(8)
    Process: 329 ExecStart=/sbin/resolvconf --enable-updates (code=exited, status=0/SUCCESS)
   Main PID: 329 (code=exited, status=0/SUCCESS)
Kemudian masukkan IP address nameserver di dalam file head konfigurasi resolvconf.

sudo nano /etc/resolvconf/resolv.conf.d/head	
Masukkan nameserver di bawah komentar.

nameserver 1.1.1.1
nameserver 8.8.8.8 
Lalu jalankan update resolv.conf.

sudo resolvconf --enable-updates
sudo resolvconf -u	
Verifikasi dengan menampilkan isi file resolv.conf.

cat /etc/resolv.conf

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.

nameserver 1.1.1.1
nameserver 8.8.8.8
nameserver 127.0.0.53	
Jika ingin mengubah atau menambahkan IP address nameserver lain, ubah kembali file head, dan jalankan update resolvconf.

sudo resolvconf -u 



Sumber : https://musaamin.web.id/cara-setting-resolv-conf-permanen-ubuntu/

Share with your friends

Give us your opinion

Notification
This is just an example, you can fill it later with your own note.
Done