Configuring A General-Purpose Ubuntu 14.04 Server

Over the years I’ve used many different hosting solutions. From shared hosting, a dedicated server, to several VPSes. These all came with a graphical control panel, most often Plesk, from which the server could be administered. The downside was the cost of the licence. So a little while ago I took the plunge and purchased …

Continue reading ‘Configuring A General-Purpose Ubuntu 14.04 Server’ »

Extract Domain Name From Hostname in PHP

When fighting spammers or other unwanted traffic it’s useful to be able to block a top level domain, such as or This needs to be extracted from the full hostname, which might be something like To do that you’ll need a combination of a PHP built-in function and a regular expression.

IP-to-Country DNS Mapping Service

Want to block email from specific countries? Want to check a visitor’s country within your PHP script? It’s all quite easy using this free IP-to-country DNS mapping service!