Thanks all,
at least I now know what to look for. FYI it is Fedora 8, default install
sudo -u apache dig http://www.yahoo.com works
Interestingly, when I do:
sudo -u apache ./lwptest.cgi
it works, so I don't think it's related to the user permissions, pushing me back to the idea of paths.