How to allow traffic from a hostname with dynamic address

This is a reminder on how to allow traffic from a windows machine to my Linux machine when that windows machine has a dynamic IP that changes once a day at least.  I want to have this answer at hand when needed.

I got this solution from this stackexchange answer.

Here you have:

sudo iptables -A INPUT -p tcp --src MyComputer-a1H75wMROeh.companydomain.com -j ACCEPT

If you want to allow access from the same machine but using a specific port, like ssh:

sudo iptables -A INPUT -p tcp --src MyComputer-a1H75wMROeh.companydomain.com --dport 22  -j ACCEPT

 

And that’s all for now!