There is a simple enough syntax for firewalls. Look for example files.
There is also opendns.org. You can filter your own dns request by
- Creating a user or account with them
- Configure your dns as required.
- Use a download from them to identify your xurrent ip with that account so you get your preconfigured service.
That sorts your access, along with noscript or ublock addons. If this is a server online 24/7, get serious and pay someone to set ut up.