Create an DNS server self-hosted on Virtual Machine Ubuntu Server with Bind9
- Make
192.168.1.10
as resolver if user accesstesting.gbesar.com
- User change resolver on
/etc/resolv.conf
to ipBIND9
Virtual Machine
Install bind9
apt install -y bind9
nano /etc/bind/named.conf.local
zone "testing.gbesar.com" {
type master;
file "/etc/bind/testing.gbesar.com";
};
nano /etc/bind/testing.gbesar.com
$TTL 86400
@ IN SOA testing.gbesar.com. www.testing.gbesar.com. (
2020071601 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
@ IN NS ns1.testing.gbesar.com.
@ IN NS ns2.testing.gbesar.com.
@ IN A 192.168.1.10
ns1 IN A 192.168.1.10
ns2 IN A 192.168.1.10
www IN CNAME testing.gbesar.com.
named-checkzone testing.gbesar.com /etc/bind/testing.gbesar.com
systemctl restart bind9
## Linux
nano /etc/resolv.conf
nameserver YOUR_BIND9_VP_IP
ping testing.gbesar.com