i recently had to set up domain mapping for a friend who has blog running on my network and due to the company they had their hosting and domain with it was a bit of a pain but we got it to work and so i thought i'd write a quick explanation of how.
i'm using wordpress 3.1.2 on a linux server with the latest apache/mysql/php combo with cpanel. i've got my network set up with sub directories rather than subdomains (i don't like the way subdomains look!)
(if you haven't installed the MU-Domain Mapping plugin then none of this will make sense! get it here though if you'll be mapping other people's domains to your network. follow the straight forward installation instructions and then read on...)
Step 1: locate the IP Address of your site's (mainsite.com) server (eg: 188.8.131.52)
Step 2: if it's a domain name that you own that you're trying to map then go to your domain registrar, log in to your account and navigate to the DNS Management section. be careful, this is a potentially dangerous place to tinker about!. if it's not yours, carefully instruct your client or site member in how to do
Steps 2 & 3.
Step 3: Locate the section called A Record. create a new A Record using the IP Address of your server from Step 1. Save your changes.
now, this change could take a few hours to resolve (it might not, it depends on the mood of the internet!) so don't worry about checking it for a while. in the meantime...
Step 4: in your hosting cpanel go to the Parked Domains section and add a new one, ie: the domain name you're mapping (mydomain.com). save your changes.
Step 5: in Parked Domains you should now see your domain name (eg: mydomain.com) listed. click on "Manage Redirects" and add the full address of the sub directory you're mapping the domain to, ie: http://mainsite.com/mysubdirectory save your changes.
you need to do Steps 4 & 5 even if it's not your own domain you're mapping
the next step is done in your wordpress dashboard (or the dashboard of your client/member's site). if you're sorting it from your own dashboard then go to Network Admin -> Sites and find the Blog ID of the subdirectory you want to map the domain to (just hover your cursor over the site name in the list and note the ID number in the bottom address bar of your browser). then...
Step 6: if you're doing your own domain mapping go to Tools -> Domains and add the new one using the Blog ID number and the domain name you're mapping, ie: mydomain.com. select the check box for use as primary and click save.
Step 6a: if you're not mapping your own domain but have set the option to let your members map their own domains then after a few hours of waiting for the internet to catch up with your IP Address changes, tell your user to go to Tools -> Domain Mapping and they should see the domains that are available to them. they should select the domain they want to map and choose "Set Primary Domain".
if everything has been set correctly and the IP Address has propagated through the DNS network then when you type http://mydomain.com into your browser's address bar it should take you to http://mainsite.com/mysubdirectory but show mydomain.com in the address bar.
i hope this helps (and works!). i can't speak to setting it up with subdomains, there are a few tutorials out there for that (setting wildcard thingies etc)
if anyone has any comments or suggestions then please feel free to add them. i've used this process twice and it's worked both times (albeit with a bit of kerfuffle the second time!)
take 'er easy, dude.