Created
July 16, 2025 23:24
-
-
Save magicstone1412/f9a4505d7f39828a9b6dfba737d578e1 to your computer and use it in GitHub Desktop.
Mikrotik - Automatically add Roblox IP from DNS Cache to Address List
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:foreach dnscache in=[/ip dns cache find] do={ | |
:local dnscacheVal [/ip dns cache get $dnscache] | |
:local name ($dnscacheVal->"name") | |
:local data ($dnscacheVal->"data") | |
:local type ($dnscacheVal->"type") | |
# Only process if name contains "roblox" | |
:if ($name ~ "roblox") do={ | |
:if ($type = "A") do={ | |
:if ([:len [/ip firewall address-list find where list="IP Roblox" and address=$data]] = 0) do={ | |
/ip firewall address-list add list="IP Roblox" address=$data comment="IP Roblox" | |
} | |
} | |
:if ($type = "CNAME") do={ | |
:if ([:len [/ip firewall address-list find where list="IP Roblox" and address=$name]] = 0) do={ | |
/ip firewall address-list add list="IP Roblox" address=$name comment="IP Roblox" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/system scheduler add name="scan-dns-roblox" interval=50s on-event=dns-roblox-scan policy=read,write,test