servername in apache httpd.conf

I'd like to know if servername in apache httpd.conf is the machine name or domain name. If it is domain name like example.com, should it be registered before in use?

Depends on your webserver is setup. If you are using the VirtualHost directive for all the sites being hosted, then the ServerName parameter within httpd.conf can be the hostname of the machine as it isn't used. If you only have 1 site being hosted without VirtualHost then the ServerName is to reflect the site being hosted and would have to be a registered DNS name.

Mike