Port 53 open on external, I don't know why

Did a remote port scan and it says port 53 is open. I’m confused by that as I don’t have anything in the IP>Firewall section for port 53.

I do have some things in the IP>NAT section for port 53, but I thought that was all facing internal. Clearly I’ve misunderstood.

[admin@gateway] > ip/firewall/nat/ print
Flags: X - disabled, I - invalid; D - dynamic 
 0    ;;; defconf: masquerade
      chain=srcnat action=masquerade out-interface-list=WAN ipsec-policy=out,none 

 1    ;;; DNS Redirect UDP
      chain=dstnat action=dst-nat to-addresses=10.1.0.2 to-ports=53 protocol=udp src-address=!10.1.0.2/31 dst-port=53 
      log=no log-prefix="" 

 2    ;;; Rewrite DNS lookups UDP
      chain=srcnat action=masquerade to-ports=53 protocol=udp dst-address=10.1.0.2 dst-port=53 log=no log-prefix="" 

 3    ;;; DNS Redirect TCP
      chain=dstnat action=dst-nat to-addresses=10.1.0.2 to-ports=53 protocol=tcp src-address=!10.1.0.2/31 dst-port=53 
      log=no log-prefix="" 

 4    ;;;  Rewrite DNS lookups TCP
      chain=srcnat action=masquerade to-ports=53 protocol=tcp dst-address=10.1.0.2 dst-port=53 log=no log-prefix=""

Not sure why any of these rules would be responding externally. Please help me understand.

Please post full config
/export file=anynameyouwish ( minus router serial number, any public WANIP information, keys )

Here you go. Thanks for looking.

# 2025-05-18 14:10:45 by RouterOS 7.18.2
# software id = MH6J-YZ08
#
# model = E50UG
# serial number = 12345678900
/interface bridge
add admin-mac=F4:1E:57:XX:XX:XX auto-mac=no comment=defconf name=bridge
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/ip pool
add name=dhcp ranges=10.1.0.200-10.1.0.230
/ip dhcp-server
add address-pool=dhcp disabled=yes interface=bridge name=defconf
/disk settings
set auto-media-interface=bridge auto-media-sharing=yes auto-smb-sharing=yes
/interface bridge port
add bridge=bridge comment=defconf interface=ether2
add bridge=bridge comment=defconf interface=ether3
add bridge=bridge comment=defconf interface=ether4
add bridge=bridge comment=defconf interface=ether5
/ip neighbor discovery-settings
set discover-interface-list=none
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
/interface ovpn-server server
add mac-address=FE:1F:09:XX:XX:XX name=ovpn-server1
/ip address
add address=10.1.0.1/24 comment=defconf interface=bridge network=10.1.0.0
/ip cloud
set update-time=no
/ip dhcp-client
add comment=defconf interface=ether1
/ip dhcp-server network
add address=10.1.0.0/24 comment=defconf dns-server=10.1.0.2 gateway=10.1.0.1
/ip dns static
add address=10.1.0.1 comment=defconf name=router.lan type=A
/ip firewall filter
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=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 hw-offload=yes
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
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" \
    ipsec-policy=out,none out-interface-list=WAN
add action=dst-nat chain=dstnat comment="DNS Redirect UDP" dst-port=53 \
    protocol=udp src-address=!10.1.0.2/31 to-addresses=10.1.0.2 to-ports=53
add action=masquerade chain=srcnat comment="Rewrite DNS lookups UDP" \
    dst-address=10.1.0.2 dst-port=53 protocol=udp to-ports=53
add action=dst-nat chain=dstnat comment="DNS Redirect TCP" dst-port=53 \
    protocol=tcp src-address=!10.1.0.2/31 to-addresses=10.1.0.2 to-ports=53
add action=masquerade chain=srcnat comment=" Rewrite DNS lookups TCP" \
    dst-address=10.1.0.2 dst-port=53 protocol=tcp to-ports=53
/ip ssh
set host-key-type=ed25519 strong-crypto=yes
/ipv6 firewall address-list
add address=::/128 comment="defconf: unspecified address" list=bad_ipv6
add address=::1/128 comment="defconf: lo" list=bad_ipv6
add address=fec0::/10 comment="defconf: site-local" list=bad_ipv6
add address=::ffff:0.0.0.0/96 comment="defconf: ipv4-mapped" list=bad_ipv6
add address=::/96 comment="defconf: ipv4 compat" list=bad_ipv6
add address=100::/64 comment="defconf: discard only " list=bad_ipv6
add address=2001:db8::/32 comment="defconf: documentation" list=bad_ipv6
add address=2001:10::/28 comment="defconf: ORCHID" list=bad_ipv6
add address=3ffe::/16 comment="defconf: 6bone" list=bad_ipv6
/ipv6 firewall filter
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 ICMPv6" protocol=\
    icmpv6
add action=accept chain=input comment="defconf: accept UDP traceroute" \
    dst-port=33434-33534 protocol=udp
add action=accept chain=input comment=\
    "defconf: accept DHCPv6-Client prefix delegation." dst-port=546 protocol=\
    udp src-address=fe80::/10
add action=accept chain=input comment="defconf: accept IKE" dst-port=500,4500 \
    protocol=udp
add action=accept chain=input comment="defconf: accept ipsec AH" protocol=\
    ipsec-ah
add action=accept chain=input comment="defconf: accept ipsec ESP" protocol=\
    ipsec-esp
add action=accept chain=input comment=\
    "defconf: accept all that matches ipsec policy" ipsec-policy=in,ipsec
add action=drop chain=input comment=\
    "defconf: drop everything else not coming from LAN" in-interface-list=\
    !LAN
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 packets with bad src ipv6" src-address-list=bad_ipv6
add action=drop chain=forward comment=\
    "defconf: drop packets with bad dst ipv6" dst-address-list=bad_ipv6
add action=drop chain=forward comment="defconf: rfc4890 drop hop-limit=1" \
    hop-limit=equal:1 protocol=icmpv6
add action=accept chain=forward comment="defconf: accept ICMPv6" protocol=\
    icmpv6
add action=accept chain=forward comment="defconf: accept HIP" protocol=139
add action=accept chain=forward comment="defconf: accept IKE" dst-port=\
    500,4500 protocol=udp
add action=accept chain=forward comment="defconf: accept ipsec AH" protocol=\
    ipsec-ah
add action=accept chain=forward comment="defconf: accept ipsec ESP" protocol=\
    ipsec-esp
add action=accept chain=forward comment=\
    "defconf: accept all that matches ipsec policy" ipsec-policy=in,ipsec
add action=drop chain=forward comment=\
    "defconf: drop everything else not coming from LAN" in-interface-list=\
    !LAN
/system clock
set time-zone-name=America/Denver
/system identity
set name=gateway
/system note
set show-at-login=no
/system ntp client
set enabled=yes
/system ntp client servers
add address=10.1.0.3
add address=10.1.0.18
/tool bandwidth-server
set enabled=no
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN

Anav probably wanted to see the full configuration because there could’ve been a firewall rule or something else that could’ve been a security issue but even from the NAT snippet one could draw a conclusion what the reason is:

1    ;;; DNS Redirect UDP
      chain=dstnat action=dst-nat to-addresses=10.1.0.2 to-ports=53 protocol=udp src-address=!10.1.0.2/31 dst-port=53 
      log=no log-prefix=""

This rule redirects any packet with destination port 53, regardless whether it’s from WAN or LAN, to 10.1.0.2, with the exception of itself. So technically the aforemetioned port is open to the whole wide web and that could be easily fixed with adding a parameter in-interface-list=LAN

Ok that makes sense now. Yes changing it to in-interface-list=LAN does no longer show up from an external scan. Thanks!

That is correct, I do not even look at snippets LOL, good pickup by cat.