There are a few settings there are minimal:
In the nameserver you have to add a A record, this is the line that points an domainname to a server:
example.com. IN A 123.456.7.89
A CNAME is an alias, it isn't an actual other page. You can use this to point the another value to the same location:
www IN CNAME example.com.
alias-of-example.com. IN CNAME example.com.
Why a CNAME when
www IN A 123.456.7.89 works? Because it's a lot easier to maintain, in case of server change all you have to do is change 1 IPaddress.
Settings for a hosting, or in your hosting settings
When registring a domain, at some points this has to get globally known, thats what nameservers are for. It starts with a root Authority (highest of the chain), all the way to small companies.
You (if you even have to) have to configure nameservers (which in turn have the dns settings like above). One of the bigger nameservers points to the servers of [hosting_company], you (or they) have to do the final step and point it to the domain:
example.com. IN NS ns1.some-nameserver.com.
example.com. IN NS ns2.some-nameserver.com.
Always a minimum of two. Of the first one is down or too slow, it will try the next. Highend websites often have 4 nameservers.
Why no dot after the www, but one after the domain?
Great question. The dot means 'end of the string'. If no dot, the domain will be added:
asuming example.com as base
www. means www
www means www.example.com
something.com. means something.com
something.com means something.com.example.com
Should I do all this?
Big chance you don't have to. Most hosting companies do this for you or it's an automated process (at least with some default settings). These settings often are for the more advanced users who need to add other information (like
mx records for mail).