How can I Block the hostname?

hi
How can I Block the hostnames such as xxx.dyndns.org with dinamic IP on my Mikrotic routerboard?

I add new firewall Rules such as: chain=forward Src.Address=hostname Dst.Address=0.0.0.0/0 Action=Drop
But when i apply them , hostname in Src.Address changed with IP.
because their IP is not static i can block them only for many houres and when they update their host with new IP , They can connect me.

please kindly inform me how can i block the hostnames with Dinamic IP?

you can only do this if you use webproxy, and add these in the access list with action block

hi
tanx for your answer but i could not block the hosts in web proxy.
i added rules with this parameters:
Src.Address = the host of someone who i want to block him such as xxx.dyndns.org
Dst.Address = 0.0.0.0/0
Dst.Host = the host of someone who i want to block him such as xxx.dyndns.org
Action = deny

but it didnot work.
and xxx.dyndns.org could connect me.

plz kindly explain more

regards

is there any suggestion?
im waiting for your help.

I resolved similar problem this way:

:foreach i in=[/ip firewall address-list find list="Blocked"] do={/ip firewall address-list remove $i}
 
/ip firewall address-list add address=[:resolve "somehost.com"] list="Blocked"

Schedule it once in 5-15 minute and create rule for that address-list

hi sir

it seems very great but i can not understand perfectly :frowning:

kindly explain more about rules with a example

for example i want block the host name such as “hostname.dyndns.com
what must i do first and second and third …

great regards

hi mr anjey

im waitting for your help.

kindly explain more about rules with a example

for example i want block the host name such as “hostname.dyndns.com
what must i do first and second and third …

great regards

i had the same problems
i use RB750 on dhcp server leases found 2 hostname always changing mac add and getting new ip

i tried anjey code but it always said “failure: dns name does not exist”

:foreach i in=[/ip firewall address-list find list="Blocked"] do={/ip firewall address-list remove $i}
 
/ip firewall address-list add address=[:resolve "android-565e71df87fc52c3"] list="Blocked"
/ip firewall address-list add address=[:resolve "android-77ea7bf356e363d9"] list="Blocked"