Community discussions

MikroTik App
 
Shy
Member Candidate
Member Candidate
Topic Author
Posts: 243
Joined: Sat Jun 13, 2020 8:17 am

HEX s as DNS

Wed Jul 29, 2020 6:52 pm

Hey
I am facing some issues to use the hexs as dns. Suddenly it stopped to work... what can be the issue?
 
Shy
Member Candidate
Member Candidate
Topic Author
Posts: 243
Joined: Sat Jun 13, 2020 8:17 am

Re: HEX s as DNS  [SOLVED]

Wed Jul 29, 2020 7:02 pm

found the solution I think:)
In Winbox under IP -> DNS ensure that Allow Remote Request Box is checked, that should be the first step. Then under IP -> DHCP Server -> Networks and the configurations that the DNS server is set to the IP of the router board, also specify a Domain suffix (eg Home.local).
 
Shy
Member Candidate
Member Candidate
Topic Author
Posts: 243
Joined: Sat Jun 13, 2020 8:17 am

Re: HEX s as DNS

Wed Jul 29, 2020 9:26 pm

I also needed to allow DNS in firewall
[admin@MikroTik] /ip firewall filter> add action=accept chain=input comment="Allow LAN DNS queries-UDP" dst-port=53 \   \... in-interface-list=LAN protocol=udp                                                                                 [admin@MikroTik] /ip firewall filter> add action=accept chain=input comment="Allow LAN DNS queries - TCP" dst-port=\    \... 53 in-interface-list=LAN protocol=tcp    
 
 
pe1chl
Forum Guru
Forum Guru
Posts: 10534
Joined: Mon Jun 08, 2015 12:09 pm

Re: HEX s as DNS

Wed Jul 29, 2020 9:28 pm

That is correct, but MAKE SURE that you have a CORRECT FIREWALL set up!
The default firewall is OK. When you have changed it (maybe following some bad advice from Youtube) it can be that your DNS service is reachable from internet.
If so, you are going to be in big trouble soon. Fix it before it is too late.
Edit: I see you are already fiddling with the firewall. That should not be required to get it working. Please show your entire firewall config.
 
Shy
Member Candidate
Member Candidate
Topic Author
Posts: 243
Joined: Sat Jun 13, 2020 8:17 am

Re: HEX s as DNS

Wed Jul 29, 2020 10:09 pm

I have checked the dns queries from wan which isnt working so probably it looks ok.
 
Shy
Member Candidate
Member Candidate
Topic Author
Posts: 243
Joined: Sat Jun 13, 2020 8:17 am

Re: HEX s as DNS

Wed Jul 29, 2020 10:14 pm

See attached
# jul/29/2020 22:16:14 by RouterOS 6.47

/ip firewall filter
add action=accept chain=input comment="Allow LAN DNS queries-UDP" dst-port=53 \
    in-interface-list=LAN protocol=udp
add action=accept chain=input comment="Allow LAN DNS queries - TCP" dst-port=\
    53 in-interface-list=LAN protocol=tcp
add action=accept chain=input comment=\
    "defconf: accept established,related,untracked" connection-state=\
    established,related,untracked
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
    invalid
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment=\
    "defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
add action=add-src-to-address-list address-list=port:X000 \
    address-list-timeout=1d chain=input comment=\
    "Allow port known for port X000 and then X080 from secure addresses" \
    dst-port=X000 protocol=tcp
add action=add-src-to-address-list address-list=secure address-list-timeout=\
    1d chain=input dst-port=X080 protocol=tcp src-address-list=port:X000
add action=add-src-to-address-list address-list-timeout=none-static chain=\
    input src-address-list=secure
add action=accept chain=input src-address-list=secure
add action=drop chain=input comment="defconf: drop all not coming from LAN" \
    in-interface-list=!LAN
add action=accept chain=forward comment="defconf: accept in ipsec policy" \
    ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" \
    ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
    connection-state=established,related
add action=accept chain=forward comment=\
    "defconf: accept established,related, untracked" connection-state=\
    established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" \
    connection-state=invalid
add action=drop chain=forward comment=\
    "defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
    connection-state=new in-interface-list=WAN
add action=drop chain=input

 
pe1chl
Forum Guru
Forum Guru
Posts: 10534
Joined: Mon Jun 08, 2015 12:09 pm

Re: HEX s as DNS

Wed Jul 29, 2020 10:29 pm

Ok you apparently have implemented some form of "port knocking" to access the router, and therefore it does not accept the DNS queries without those
additional rules. It would be better to place them lower in the chain, after the established/related rules.
And also I think it is not a good idea to allow external access using such a mechanism. It is not secure against portscanners.
When you want to use it on your LAN (to guard against LAN users trying to peek in your router), it may be fine. For the internet it is better to just
not allow external access to the config interface, or at least use a VPN.
 
Shy
Member Candidate
Member Candidate
Topic Author
Posts: 243
Joined: Sat Jun 13, 2020 8:17 am

Re: HEX s as DNS

Thu Jul 30, 2020 3:11 pm

totally, thats what I did...
tnx much for your reply