Panduan mendalam implementasi DNS Server dan Web Proxy pada MikroTik RB941.
DNS untuk resolve domain, Web Proxy untuk caching dan filtering konten.
Konfigurasi dual: CLI (Terminal) & WinBox (GUI).
RB941 hAP lite dengan kemampuan DNS Server dan Web Proxy. Cocok untuk jaringan rumah/kantor kecil
dengan 10-20 client. Web Proxy bisa cache konten HTTP untuk menghemat bandwidth.
CPU
AR9344 - 650MHz
RAM
32 MB DDR2
STORAGE
16 MB FLASH
ETHERNET
4x 10/100 Mbps
DNS SERVER
Built-in
WEB PROXY
Built-in
CACHE SIZE
~16 MB
CLIENT MAX
~20-50
POWER
5V DC / USB
OS
RouterOS v6 L4
DIMENSI
113 x 89 x 28mm
BERAT
160 gram
KEMAMPUAN: RB941 support DNS Server untuk resolve domain dan Web Proxy untuk caching HTTP. Web Proxy hanya cache HTTP, tidak HTTPS (HTTPS encrypted).
KONSEP DNS & WEB PROXY
FUNDAMENTAL
DNS (Domain Name System) menerjemahkan nama domain ke IP address.
Web Proxy cache konten HTTP untuk menghemat bandwidth dan mempercepat akses.
DNS SERVER
DOMAIN RESOLUTION
DNS menerjemahkan nama domain (google.com) ke IP address (142.250.x.x). Client tidak perlu hafal IP.
DNS CACHE
DNS cache menyimpan hasil resolve untuk mempercepat akses berikutnya. Mengurangi query ke DNS server luar.
DNS STATIC
DNS static untuk mapping domain ke IP tertentu. Berguna untuk block domain atau local DNS.
DNS FORWARD
DNS forward meneruskan query ke DNS server lain. Berguna untuk DNS server upstream.
WEB PROXY
HTTP CACHE
Web Proxy cache konten HTTP. Jika client minta konten yang sudah di-cache, proxy langsung kirim tanpa ke internet.
BANDWIDTH SAVING
Cache menghemat bandwidth. Konten yang sering diakses tidak perlu download ulang dari internet.
FASTER ACCESS
Konten dari cache lebih cepat karena tidak perlu ke internet. Mempercepat akses web.
CONTENT FILTERING
Web Proxy bisa filter konten berdasarkan URL, domain, atau content. Block situs tertentu.
PENTING: Web Proxy hanya cache HTTP, tidak HTTPS. HTTPS encrypted, proxy tidak bisa cache. Untuk HTTPS, perlu SSL interception (lebih kompleks).
TOPOLOGI DNS & WEB PROXY
SCHEMA
// TOPOLOGI DNS & WEB PROXY //[ INTERNET ]
|
v
+-------------------+
| MIKROTIK RB941 |
| DNS SERVER | Resolve domain
| WEB PROXY | Cache HTTP
| |
| ether1: WAN |
| ether2-4: LAN |
| wlan1: WIFI |
+-------------------+
|
v
[ CLIENT ]1. Client minta DNS: google.com2. DNS Server resolve ke 142.250.x.x3. Client akses HTTP: http://google.com4. Web Proxy check cache - Cache hit: kirim dari cache - Cache miss: ambil dari internet, cache5. Client terima response
WORKING: DNS Server resolve domain ke IP. Web Proxy cache HTTP content. Client minta domain -> DNS resolve -> Proxy check cache -> kirim response.
ANIMASI DNS & PROXY
LIVE FLOW
Visualisasi DNS resolution dan Web Proxy caching. Client minta domain -> DNS resolve -> Proxy cache check -> response.
DNS Query/Response
Proxy Cache
FLOW: Client minta domain -> DNS resolve ke IP -> Proxy check cache -> cache miss: ambil dari internet, cache -> kirim ke client.
SETUP BASIC ROUTER
STEP 01
Setup basic router sebelum konfigurasi DNS dan Web Proxy.
VIA CLI
# 1. Set identity[admin@MikroTik] > /system identity set name="DNS-PROXY"# 2. Rename interface[admin@DNS-PROXY] > /interface set ether1 name="WAN"[admin@DNS-PROXY] > /interface set ether2 name="LAN1"# 3. Set IP address[admin@DNS-PROXY] > /ip address add address=192.168.10.1/24 interface=bridge# 4. DHCP Client[admin@DNS-PROXY] > /ip dhcp-client add interface=WAN disabled=no# 5. NAT[admin@DNS-PROXY] > /ip firewall nat add chain=srcnat action=masquerade out-interface=WAN# 6. Verifikasi[admin@DNS-PROXY] > /ip address print
VIA WINBOX
1
Menu: System -> Identity: DNS-PROXY
2
Menu: Interfaces: rename ether1 -> WAN
3
Menu: IP -> Addresses: 192.168.10.1/24
4
Menu: IP -> DHCP Client: add WAN
5
Menu: IP -> Firewall -> NAT: masquerade
DNS SERVER CONFIGURATION
DNS
Konfigurasi DNS Server untuk resolve domain name ke IP address.
VIA CLI
# 1. Set DNS Server[admin@DNS-PROXY] > /ip dns set servers=8.8.8.8,8.8.4.4 allow-remote-requests=yes cache-size=2048KiB max-concurrent-queries=100# 2. Verifikasi[admin@DNS-PROXY] > /ip dns printservers: 8.8.8.8, 8.8.4.4allow-remote-requests: yescache-size: 2048KiB# 3. Test DNS[admin@DNS-PROXY] > /ping google.com count=4
VIA WINBOX
1
Menu: IP -> DNS
2
Servers: 8.8.8.8, 8.8.4.4
3
Allow Remote Requests: yes
4
Cache Size: 2048KiB
4
Max Concurrent Queries: 100
5
Klik OK
PARAMETER DNS
PARAMETER
FUNGSI
REKOMENDASI
servers
DNS server upstream
8.8.8.8, 1.1.1.1
allow-remote-requests
Allow client query
yes
cache-size
DNS cache size
2048KiB
max-concurrent-queries
Max concurrent queries
100
cache-max-ttl
Max TTL cache
1w
DNS SERVER POPULER
PROVIDER
PRIMARY
SECONDARY
Google
8.8.8.8
8.8.4.4
Cloudflare
1.1.1.1
1.0.0.1
OpenDNS
208.67.222.222
208.67.220.220
Quad9
9.9.9.9
149.112.112.112
TIPS: Gunakan DNS server yang cepat dan reliable. Google DNS (8.8.8.8) dan Cloudflare (1.1.1.1) adalah pilihan populer. Allow Remote Requests harus yes agar client bisa query.
DNS STATIC CONFIGURATION
DNS
DNS Static untuk mapping domain ke IP tertentu. Berguna untuk block domain atau local DNS.
VIA CLI
# 1. Block domain (map ke 127.0.0.1)[admin@DNS-PROXY] > /ip dns static add name="facebook.com" address="127.0.0.1" ttl=1d[admin@DNS-PROXY] > /ip dns static add name="*.facebook.com" address="127.0.0.1"# 2. Local DNS (map ke IP local)[admin@DNS-PROXY] > /ip dns static add name="server.local" address="192.168.10.50"# 3. Wildcard domain[admin@DNS-PROXY] > /ip dns static add name="*.blocked.com" address="127.0.0.1"# 4. Verifikasi[admin@DNS-PROXY] > /ip dns static print # NAME ADDRESS 0 facebook.com 127.0.0.1 1 *.facebook.com 127.0.0.1 2 server.local 192.168.10.50# 5. Test[admin@DNS-PROXY] > /ping facebook.com HOST SIZE TTL TIME STATUS 127.0.0.1 56 1d 0ms
VIA WINBOX
1
Menu: IP -> DNS -> Tab Static
2
+ Add
3
Name: facebook.com
4
Address: 127.0.0.1 (block)
5
TTL: 1d
6
Klik OK
7
Untuk wildcard: *.facebook.com
PARAMETER DNS STATIC
PARAMETER
FUNGSI
CONTOH
name
Domain name
facebook.com, *.facebook.com
address
IP address
127.0.0.1 (block), 192.168.10.50 (local)
ttl
Time to live
1d, 1h, 1w
regexp
Regular expression
.*facebook.*
TIPS: DNS Static untuk block domain dengan map ke 127.0.0.1. Wildcard (*.domain.com) untuk block semua subdomain. TTL menentukan berapa lama cache berlaku.
DNS FORWARD CONFIGURATION
DNS
DNS Forward untuk meneruskan DNS query ke DNS server lain. Berguna untuk DNS server upstream.
VIA CLI
# 1. Set DNS Forward[admin@DNS-PROXY] > /ip dns set servers=8.8.8.8,1.1.1.1 allow-remote-requests=yes# 2. Verifikasi[admin@DNS-PROXY] > /ip dns printservers: 8.8.8.8, 1.1.1.1allow-remote-requests: yes# 3. Test[admin@DNS-PROXY] > /ping google.com count=4
VIA WINBOX
1
Menu: IP -> DNS
2
Servers: 8.8.8.8, 1.1.1.1
3
Allow Remote Requests: yes
4
Klik OK
TIPS: DNS Forward meneruskan query ke DNS server upstream. Gunakan DNS server yang cepat dan reliable. Allow Remote Requests harus yes agar client bisa query.
DNS CACHE CONFIGURATION
DNS
DNS Cache menyimpan hasil resolve domain untuk mempercepat akses berikutnya.
VIA CLI
# 1. Set cache size[admin@DNS-PROXY] > /ip dns set cache-size=2048KiB cache-max-ttl=1w# 2. Flush cache[admin@DNS-PROXY] > /ip dns cache flush# 3. View cache[admin@DNS-PROXY] > /ip dns cache print # NAME ADDRESS TTL 0 google.com 142.250.x.x 1d 1 facebook.com 157.240.x.x 1d# 4. Clear cache[admin@DNS-PROXY] > /ip dns cache flush
VIA WINBOX
1
Menu: IP -> DNS
2
Cache Size: 2048KiB
3
Cache Max TTL: 1w
4
Tab Cache: lihat cache
5
Flush Cache: clear cache
TIPS: DNS Cache mempercepat akses domain yang sering diakses. Cache size 2048KiB cukup untuk kebanyakan kasus. Flush cache jika ada masalah DNS.
WEB PROXY CONFIGURATION
PROXY
Web Proxy untuk cache konten HTTP dan filter konten.
TIPS: Proxy Access untuk filter konten berdasarkan URL, domain, atau path. Wildcard (*.domain.com) untuk match semua subdomain. Action allow untuk allow, deny untuk block.
TIPS: Transparent Proxy redirect HTTP traffic ke proxy tanpa konfigurasi client. Client tidak perlu set proxy. Hanya HTTP, tidak HTTPS.
DNS + WEB PROXY COMBINED
COMBINED
Kombinasi DNS dan Web Proxy untuk optimalisasi.
VIA CLI
# 1. DNS Server[admin@DNS-PROXY] > /ip dns set servers=8.8.8.8,1.1.1.1 allow-remote-requests=yes cache-size=2048KiB# 2. DNS Static (block)[admin@DNS-PROXY] > /ip dns static add name="facebook.com" address="127.0.0.1"# 3. Web Proxy[admin@DNS-PROXY] > /ip proxy set enabled=yes listen-address=192.168.10.1 port=8080# 4. Proxy Access (filter)[admin@DNS-PROXY] > /ip proxy access add dst-host="*.youtube.com" action=deny# 5. Transparent Proxy[admin@DNS-PROXY] > /ip firewall nat add chain=dstnat protocol=tcp dst-port=80 action=redirect to-ports=8080 in-interface=bridge# 6. Verifikasi[admin@DNS-PROXY] > /ip dns print[admin@VLAN-GW] > /ip dns static print[admin@VLAN-GW] > /ip proxy print[admin@VLAN-GW] > /ip proxy access print
VIA WINBOX
1
Menu: IP -> DNS: set servers, cache
2
Tab Static: add block domain
3
Menu: IP -> Web Proxy: enable
4
Tab Access: add filter
5
Menu: IP -> Firewall -> NAT: redirect
TIPS: Kombinasi DNS + Web Proxy untuk optimalisasi. DNS untuk resolve dan block domain. Web Proxy untuk cache HTTP dan filter konten.
MONITORING DNS & PROXY
MONITORING
Monitor DNS dan Web Proxy untuk memastikan bekerja dengan baik.
VIA CLI
# 1. DNS stats[admin@DNS-PROXY] > /ip dns print# 2. DNS cache[admin@DNS-PROXY] > /ip dns cache print# 3. Proxy stats[admin@DNS-PROXY] > /ip proxy print# 4. Proxy cache[admin@DNS-PROXY] > /ip proxy cache print# 5. Proxy access[admin@DNS-PROXY] > /ip proxy access print# 6. Test DNS[admin@DNS-PROXY] > /ping google.com count=4
VIA WINBOX
1
Menu: IP -> DNS: lihat stats
2
Tab Cache: lihat cache
3
Menu: IP -> Web Proxy: lihat stats
4
Tab Cache: lihat cache
5
Tab Access: lihat access rules
TIPS: Monitor DNS dan Proxy secara berkala. Cek cache hit rate, cache size, dan access rules. Flush cache jika ada masalah.
TROUBLESHOOTING
SUPPORT
Masalah umum DNS dan Web Proxy dan solusinya.
DNS TIDAK RESOLVE
KEMUNGKINAN PENYEBAB:
1. DNS Server tidak aktif
2. DNS Server salah
3. Allow Remote Requests tidak yes
4. Koneksi ke DNS server tidak ada SOLUSI: Cek DNS Server status. Cek DNS Server IP. Cek Allow Remote Requests. Cek koneksi ke DNS server.
WEB PROXY TIDAK CACHE
KEMUNGKINAN PENYEBAB:
1. Web Proxy tidak aktif
2. Transparent Proxy tidak aktif
3. Max cache size terlalu kecil
4. HTTPS (tidak bisa cache) SOLUSI: Cek Web Proxy status. Cek Transparent Proxy. Cek Max cache size. Ingat: HTTPS tidak bisa cache.
PROXY ACCESS TIDAK FILTER
KEMUNGKINAN PENYEBAB:
1. Proxy Access rule salah
2. Transparent Proxy tidak aktif
3. Rule order salah
4. HTTPS (tidak bisa filter) SOLUSI: Cek Proxy Access rule. Cek Transparent Proxy. Cek rule order. Ingat: HTTPS tidak bisa filter.
DNS STATIC TIDAK BLOCK
KEMUNGKINAN PENYEBAB:
1. DNS Static rule salah
2. Domain salah
3. TTL expired
4. DNS cache tidak flush SOLUSI: Cek DNS Static rule. Cek domain. Cek TTL. Flush DNS cache.
DIAGNOSTIC COMMANDS
# DNS> /ip dns print> /ip dns cache print> /ip dns cache flush> /ip dns static print# Web Proxy> /ip proxy print> /ip proxy cache print> /ip proxy access print# Test> /ping google.com count=4
BEST PRACTICE
TIPS
USE RELIABLE DNS
Gunakan DNS server yang cepat dan reliable. Google DNS (8.8.8.8) dan Cloudflare (1.1.1.1) adalah pilihan populer.
DNS CACHE
DNS Cache mempercepat akses domain yang sering diakses. Cache size 2048KiB cukup untuk kebanyakan kasus.
DNS STATIC
DNS Static untuk block domain atau local DNS. Wildcard (*.domain.com) untuk block semua subdomain.
WEB PROXY CACHE
Web Proxy cache HTTP untuk menghemat bandwidth. Max cache size 16384KiB cukup untuk RB941.
PROXY ACCESS
Proxy Access untuk filter konten berdasarkan URL, domain, atau path. Wildcard untuk match semua subdomain.
TRANSPARENT PROXY
Transparent Proxy redirect HTTP traffic ke proxy tanpa konfigurasi client. Hanya HTTP, tidak HTTPS.
MONITOR REGULARLY
Monitor DNS dan Proxy secara berkala. Cek cache hit rate, cache size, dan access rules.
HTTPS LIMITATION
Ingat: Web Proxy hanya cache HTTP, tidak HTTPS. HTTPS encrypted, proxy tidak bisa cache atau filter.
CHEATSHEET
QUICK REF
DNS & PROXY COMMANDS
# DNS SERVER> /ip dns set servers=8.8.8.8,1.1.1.1 allow-remote-requests=yes cache-size=2048KiB> /ip dns print> /ip dns cache print> /ip dns cache flush# DNS STATIC> /ip dns static add name=facebook.com address=127.0.0.1> /ip dns static add name=*.facebook.com address=127.0.0.1> /ip dns static print# WEB PROXY> /ip proxy set enabled=yes listen-address=192.168.10.1 port=8080> /ip proxy print> /ip proxy cache print# PROXY ACCESS> /ip proxy access add dst-host=*.youtube.com action=deny> /ip proxy access add dst-host=google.com action=allow> /ip proxy access print# TRANSPARENT PROXY> /ip firewall nat add chain=dstnat protocol=tcp dst-port=80 action=redirect to-ports=8080 in-interface=bridge# TEST> /ping google.com count=4