My overall objective is to be able to communicate with hosts on my local network using hostnames rather than ip addresses.
For example, rather than having to use an ip address with ssh
ssh user@192.168.1.10
I want to be able to do
ssh user@servername
Or something similar.
I have set several hosts on my local network to use static ip addresses. I have also set the corresponding static routes.
However, this is not enough to be able to ssh to these devices from other hosts on the same private network.
I believe this is because the Mikrotik router is not functioning as a DNS server.
My understanding is that to enable it I need to enable “Allow Remote Requests”. However, my understanding is that this is quite dangerous, because it will listen on all interfaces including requests which come from the internet.
So - what is required to make this safe? Is it simply a case of adding the correct firewall rules to drop all traffic on port 53 except traffic from local address space?
Here is a list of my current firewall rules.
/ip firewall export
# 2025-11-21 09:04:32 by RouterOS 7.20
# software id = ZTIS-3ZFL
#
# model = E50UG
# serial number = HJ2**removed
/ip firewall filter
add action=accept chain=input comment="accept established, related, untracked" connection-state=established,related,untracked
add action=drop chain=input comment="drop invalid" connection-state=invalid
add action=accept chain=input comment="accept icmp" protocol=icmp
add action=accept chain=input comment="accept from LAN" in-interface-list=LAN
add action=drop chain=input comment="drop everything else"
add action=fasttrack-connection chain=forward comment="fasttrack established, related" connection-state=established,related hw-offload=yes
add action=accept chain=forward comment="accept established, related, untracked" connection-state=established,related,untracked
add action=drop chain=forward comment="drop invalid" connection-state=invalid
add action=accept chain=forward comment="accept from LAN to any WAN" in-interface-list=LAN out-interface-list=WAN_ALL
add action=accept chain=forward comment="accept from LAN to any LAN" in-interface-list=LAN out-interface-list=LAN
add action=accept chain=forward comment="allow reverse-nat" connection-nat-state=dstnat in-interface-list=WAN_ALL
add action=drop chain=forward comment="drop everything else"
/ip firewall nat
add action=masquerade chain=srcnat out-interface-list=WAN_ALL
Is the solution simply to add the following two rules here?
add action=drop chain=input comment="drop DNS requests not from local IP space" src_address=!192.168.1.0 port=53
add action=drop chain=forward comment="drop DNS requests not from local IP space" src_address=!192.168.1.0 port=53