I'm gonna cover most situations here, print this out, best advice.
The registrar will usually have a web based GUI so you can setup your own DNS (zone file) which contains any of the following:
A records are associated with actual IPs in your subnet and CNAME records are optional
aliases for your A record intended for adding hostnames of our choosing which define each "xxx" in xxx.yourdomain.com (i.e. www, ftp, smtp, etc.). Most people define www at least, I used ftp in my example below as well. If you have one IP for everthing, use it for your A record and CNAME all other hostnames. MX records are only for mail exchange, special records that tell the world your server also processes E-Mail.
Below is a typical
example setup that creates an A record for yourdomain.com, a sensible CNAME so users can find your website with
www.yourdomain.com, a mail.yourdomain.com alias, an MX record set with metric 0 (if you had a backup mail server, you'd define that also and use the metric to determine which one is accessed first, i.e 0 for the first and 1 for the second), and ftp.yourdomain.com which like any CNAME is optional and added for convenience. In truth the first 4 below are considered the most minimum and most sensible zone file records:
yourdomain.com IN A x.x.x.x (IP address)
www.yourdomain.com IN CNAME yourdomain.com
mail.yourdomain.com IN CNAME yourdomain.com
yourdomain.com IN MX 0 mail.yourdomain.com
ftp.yourdomain.com IN CNAME yourdomain.com
Note: All you need to remember is if a zone file is setup for you, check it out for accuracy, otherwise create it based on the typical example above. It's usually an online form with options and text fields. You might see SOA and NS records too - don't change those unless you know what you're doing, they're key records usually set by the registrar when the domain is registered or transferred to them. If you see an option for each record to set a TTL, and there are default values already set, leave them. TTL means "time to live", how long it takes in minutes (usually) for the nameserver to pickup any changes in any records. Set to a low value like 15 if you're in a rush, but after the web site can be accessed via yourdomain.com in the browser, change the TTL settings back to their original values, usually 14400. Adjust TTL is usually only adjusted temporarily for domain transfers or server migrations.
Most people do
not host their own nameserver and I did not provide help for that as that's a completely different setup. All you're doing in the instructions above is setting up the basic zone file on their web site. That in turn updates the Internet's DNS system so the world can find your web site, email is processed properly, plus any optional hostnames (i.e. ftp.yourdomain.com) are setup as you wish beyond just using yourdomain.com for everthing. It's not too hard once you know how it works under the hood. Hope this helps you!
-jim
ps: Note to jona980 -- an MX record can be either an IP -or- a previously defined CNAME so long as its hostname has an A record.