In general this is only possible server side. If you want to block a IP you can block it on the server by several methods (on system level, on apache, on nodejs, etc)
For sure you can also fetch the address on client side with ie ipfy.org API request and show ie error message, but that’s not a serious approach.