OK. Found it: wp-includes/functions-post.php
Got it working. Thanks.
You do need a .htaccess file to have permalinks. If there is no .htaccess at the moment, make sure you copy ALL content from the admin (Press Ctrl+A to select all, and Ctrl+C to copy) and paste it onto a plain text document, save, and upload.
If there is a .htaccess, append the content from admin to it.
My webhost suggests changing gethostbyaddr() to @gethostbyaddr().
Where should I change this? I can’t find it being directly called by wp-includes/comment-functions.php
I don’t have any spam plugins. It’s the default installation.
My web host mentioned that it might be a case of proxy address _and_ the the local IP both being queried in gethostbyaddr() or something.