How to mikrotik hotspot redirect dns

Ditulis oleh: -

How to mikrotik hotspot redirect dns - Disable Redirect DNS Hotspot MikroTik For Active Users - Sometimes we implemetasikan mikrotik hotspot feature on our network, such as offices, restaurants, cafes, schools, campus, etc.. Which requires internet users need authentication / login first before using internet connection. 

But, after login. All DNS user requests must be routed via the mikrotik router DNS. Well this time case exist in some network environment, user need access to other DNS (Internal DNS Server, OpenDNS or Google Public DNS). If the test using "namebench" our DNS looks directed automatically / forced through the DNS router mikrotik ( DNS Proxying ).
Mikrotik Hotspot DNS Proxying

Mikrotik Hotspot DNS Proxying

From googling and direct try2, it turns out that hotspot mikrotik feature automatically add rules redirect dns in " / ip firewall nat " if we " print " in the terminal seen rules 2 lines like this:

2 D chain = hotspot action = redirect to-ports = 64872 protocol = udp dst-port = 53
3 D chain = hotspot action = redirect to-ports = 64872 protocol = tcp dst-port = 53

Because we want users who are not active / not yet logged in to our static dns hotspot, and ignore the above 2 rules for users who are already logged. Then we need to add the option " hotspot =! Auth " to the two lines.

set 2.3 hotspot =! auth

The result will be like this:

2 D chain = hotspot action = redirect to-ports = 64872 protocol = udp hotspot =! Auth dst-port = 53 
3 D chain = hotspot action = redirect to-ports = 64872 protocol = tcp hotspot =! Auth dst-port = 53

Active hotspot users can now use custom DNS on their gadgets, without being directed automatically / forced through the mikrotik router DNS.

1 komentar: