This is mostly for one of my customers, but I hope it’s generally useful.
First, you have to understand what a domain is. It’s the name of a set of resources on the Internet with a common owner. Most often, a domain consists of a unique name followed by a standard top-level domain. A top-level domain can be a general-purpose one such as .com or .org, or it can be a country code such as .uk or .us. Country codes are often used as general-purpose ones, especially when they belong to small countries trying to make a little extra money selling domains.
A domain can have subdomains. Those are additional text strings in front of the primary domain. separated by a period. For instance, mail.mydomain.com is a subdomain of mydomain.com. You register the primary domain, and then you can create all the subdomains of it that you want.
A domain that starts with “www.” (e.g., www.mydomain.com) is a subdomain. You register mydomain.com, not www.mydomain.com. However, “www” is so common that some registrars like to make it look as if you’re registering www.mydomain.com. They’re just trying to make it simpler to understand.
A URL (universal resource locator) is different from a domain. It points to a particular page or resource. It has a protocol at the front and may have a path at the end. An example is http://www.mydomain.com/index.html . Links use URLs. It’s common to talk about a link and a URL as if they were the same thing.
The best way to find out if a domain is available is to use a whois tool. It gives you registration information about the domain if it’s registered, or tells you that it can’t find the domain. If it can’t find it, that’s a strong but not absolute indication that it’s available. It might fail to find a domain that was very recently registered, or the domain might be one that isn’t available at all (usually because the top-level domain has restrictions). You can use whois from the command line, or from network-tools.com or several other online whois tools. (Full disclosure: I get paid to write for network-tools.com.)
Some domains are available from resellers. If you’re willing to pay a premium price for a specific name, you can look into them, but it’s going to cost a lot more than registering an available domain.
If you decide you want a domain for your own use, you should register it as soon as possible, and definitely before mentioning it publicly. (If you’re searching for a domain on someone else’s behalf, though, don’t register it!) A domain that’s available today might not be available tomorrow. Registering a domain is cheap, and finding a good unclaimed one is hard.
You can choose from a lot of competing registrars. They vary in price and support. Keep both factors in mind when picking one.
Registering a domain doesn’t automatically give you a website. You have to create a site on a server, and then set up DNS records for it through your registrar. Some registrars will give you free domain hosting, but it’s going to be extremely limited, perhaps just one page.
A domain registration is for a fixed period of time, usually a multiple of 1 year. Make sure to renew it before it expires.