Install DNS Server BIND
1. $ sudo apt-get install bind9
Install DNS Server BIND
IP Address yang saya gunakan 192.168.1.1 dengan nama domain aditya.lan
1
2
3
|
. $ sudo
su
. # cd /etc/bind/
. # nano named.conf.local
|
|
|
Tambahkan script di bawah ini :
zone "aditya.lan" {
type master;
file "/etc/bind/db.ubuntu";
};
zone
"1.168.192.in-addr.arpa" {
type master;
notify no;
file "/etc/bind/db.1";
};
|
Copy file db.local
# cp db.local
db.ubuntu
# cp db.local db.1
|
;
; BIND data file for local loopback
interface
;
$TTL 604800
@
IN SOA ns.aditya.lan. root.aditya.lan. (
2
; Serial
604800
; Refresh
86400
; Retry
2419200
; Expire
604800
) ; Negative Cache TTL
;
@
IN NS ubuntu.lan.
@
IN A 192.168.1.1
ns
IN A 192.168.1.1
www
IN CNAME aditya.lan.
|
Edit db.1, scriptnya :
;
; BIND data file for local loopback
interface
;
$TTL
604800
@
IN SOA ns.ubuntu.lan. root.aditya.lan. (
2
; Serial
604800
; Refresh
86400
; Retry
2419200
; Expire
604800
) ; Negative Cache TTL
;
@
IN NS aditya.lan.
1
IN PTR aditya.lan.
ns
IN PTR 192.168.1.1
www
IN PTR 192.168.1.1
|
Tambahkan dns-nameserver pada konfigurasi interface
# nano
/etc/network/interfaces
dns-nameservers
192.168.1.1
dns-search aditya.lan
Pengujian
$ nslookup aditya.lan
nslookup aditya.lan
Server:
192.168.1.1
Address:
192.168.1.1#53
Name:
aditya.lan
Address: 192.168.1.1
|
Pengujian terakhir akses http://aditya.lan
|
Sumber : https://wiki.ubuntu.com/