how to setup local domain on mikrotik router
1 min read

how to setup local domain on mikrotik router

topologi


ip address dan dhcp-server

/ip address
add address=192.168.155.1/24 interface=bridge1 network=192.168.155.0
/ip pool
add name=dhcp_pool0 ranges=192.168.155.2-192.168.155.200
/ip dhcp-server
add address-pool=dhcp_pool0 disabled=no interface=bridge1 lease-time=3d10m name=dhcp1
/ip dhcp-server network
add address=192.168.155.0/24 dns-server=192.168.155.1 gateway=192.168.155.1

ip dns

/ip dns
set allow-remote-requests=yes servers=8.8.8.8
/ip dns static
add address=192.168.155.254 name=anshari.web.id

firewall

/ip firewall layer7-protocol
add name=anshari regexp="anshari.web.id"
/ip firewall mangle
add action=mark-packet chain=prerouting dst-address-type=local dst-port=53 layer7-protocol=anshari new-packet-mark=forwarded-dns passthrough=yes protocol=udp
/ip firewall nat
add action=dst-nat chain=dstnat packet-mark=forwarded-dns to-addresses=192.158.155.254
add action=masquerade chain=srcnat