Skip to content

Instantly share code, notes, and snippets.

@magicstone1412
Created July 16, 2025 23:24
Show Gist options
  • Save magicstone1412/f9a4505d7f39828a9b6dfba737d578e1 to your computer and use it in GitHub Desktop.
Save magicstone1412/f9a4505d7f39828a9b6dfba737d578e1 to your computer and use it in GitHub Desktop.
Mikrotik - Automatically add Roblox IP from DNS Cache to Address List
: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"
}
}
}
}
@magicstone1412
Copy link
Author

/system scheduler add name="scan-dns-roblox" interval=50s on-event=dns-roblox-scan policy=read,write,test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment