Get Dynamic IP for Domains
From MikroTik Wiki
Get Dynamic IP for Domains
This article is about getting Dynamic IP's for domains such as youtube.com and facebook.com. This is useful when particular task is needed to be done for such domain, tasks such as different route, QoS, prioritization, etc.
First I will cover the CLI section, then I will show snapshots of the same.
The following example will be done for youtube.com and facebook.com. Also that this example assumes that local network IP Subnet is 10.10.0.0/16.
Create firewall rules to add each IP visited by users to a dynamic IP Address-List which can be used later.
/ ip firewall filter add chain=forward action=add-dst-to-address-list protocol=tcp src-address=10.10.0.0/16 address-list=youtube-list address-list-timeout=0s content=youtube.com comment="youtube.com IPs"
/ ip firewall filter add chain=forward action=add-dst-to-address-list protocol=tcp src-address=10.10.0.0/16 address-list=facebook-list address-list-timeout=0s content=facebook.com comment="facebook.com IPs"
/ ip firewall filter add chain=forward action=add-dst-to-address-list protocol=tcp src-address=10.10.0.0/16 address-list=facebook-list address-list-timeout=0s content=fbcdn.net comment="Facebooks content delivery network IPs"