If you wish to setup a site for a client or a free site for a friend on your hosting plan, the domain name may reside in their account so you will need to point it to your site. The following works for godaddy hosting and a domain registered somewhere else, but should work the same for most registrars.
First name the secondary domain you setup to be the same as the clients domain name, and choose any folder name that is unique. I use a folder name the same as the domain so I can keep track of where things are if I need to make changes later with a ftp file manager. For example if your friend’s domain is named clientsdomain.com, you would set up a secondary domain on your host called clientsdomain.com and choose a directory, or folder, called clientsdomain. If your host account primary domain is myhost.com than the folder will be at myhost.com/clientsdomain. You can use any name you want for the secondary domain name even if you do not own it since public access will be through myhost.com/clientsdomain.
Next, Install WordPress through godaddy by choosing the secondary directory you created. Once you do that you will be able t access the new site by logging into myhost.com/clientsdomain/wp-login to set up your fiend’s WordPress site. Once you agree that the site is viewable to the public than you need to go to the client’s account and point the A record to the IP address of myhost.com. This can take an hour or more so be patient. Confirm that going to clientsdomain.com gets you to myhost.com/clientsdomain. This will work fine, however myhost.com/clientsdomain/… will show in the URL window of a reader’s browser if he goes to links within your new site.
The final step is to make the site look like it should in the URL so the the reader knows he is on the correct site. You need to login to the WordPress site on myhost.com/clientsdomain and go to Settings>General. Change the WordPress Address (URL) and the Site Address (URL) from http://myhost.com/clientsdomain to http://clientsdomain.com and select Save Changes. The site will disappear and you will need to refresh it once or twice, but when it returns the URL window in the browser will properly display the intended domain for all internal links.
It is important that you follow the steps in order or you may lose the ability to log in to your site. WordPress will use the new domain to access the files so if you do not wait for the IP address to resolve before updating the WordPress settings you could lose access and get 404 errors or blank pages. If you start making changes to fix this you may create database errors or errors in the wp-config file. Do not use domain forwarding from your client’s account or you will not be able to show the proper URL.
This is an easy way to host your fiends’ sites for free on a unlimited hosting plan and allow them to retain their domains in their accounts.