Guide to setting up domains
Page contents
Domain basics
A domain is simply the name you type into a web browser to access a website. The part of the name to the far right, for example .com, .org or .dk is known as the top level domain (TLD) while the part before that is the second level domain (SLD). So for bobpeers.com, .com is the TLD and bobpeers is the SLD.
Technically you don't buy a domain, you rent it on a yearly basis, but once you do this you can renew every year and it will always be yours. Many companies are able to sell domain names, these are called registrars, and once bought you can choose to 'park' your domain name with them so you can manage your domain name setting (DNS) from the same site you bought the domain.
DNS is the system that translates domain names into the numerical computer names called IP (internet protocol) addresses, so when you type www.bbc.co.uk into a browser the program looks up the actual IP address of the server that has the pages, which in this case is 212.58.224.36. If you type http://212.58.224.36/ you will arrive at the same site, the homepage of BBC news.
Purchasing the domain
First you need to buy a domain name. These are very cheap these days but it depends on which TLD you wish to buy and where you get it from. I bought bobpeers.com from namecheap for $8.88 but another cheap company is GoDaddy.
If you don't have, or don't need a website, and maybe only want to receive email on you own domain then you just need to set up mail forwarding with the registrar. This is done by logging in to the registrars site and adding a mail forward.
This means that emails sent to something@example.tld will be forwarded to your normal email address. I recommend that you at least add a 'catchall' option, this is done by adding a * (wild card) address that forwards to your email address. This means that an email sent to any address where the domain part is your domain will be forwarded to you.
Once the domain is bought you need a place to host the website, most of the domain sellers also have hosting but again this is an area where prices vary enormously and it's easy to pay $10 per month for a basic site without PHP or databases. You might also check to see whether any web space is given to you by your ISP as part of your package.
I personally use vonetwork, it's probably not as fast as some providers and maybe reliability is not up to enterprise standards, however the basic plan costs $12.95 per year including 100Mb of server space, 1Gb per month bandwidth, PHP, MySQL and POP3 email accounts. You can also choose between Linux and Windows hosting.
Getting nameservers
If you choose to leave the DNS settings in the hands of the registrar you can just log into the registrars site and manage the DNS from there, by default your domain will be set up using the nameservers of the registrar, however there are alternatives. You can use the nameservers allocated to you by the web host (if you have one they should be sent to you in a welcome email) or alternatively you can use free domain managers such as ZoneEdit.
All you need to do is to create an account with them first, this service can be very useful if you have many domains as you then have a central location to manage all your DNS setting instead of having to log into many different sites. To change the nameservers with your registrar just log in to your registrars site and change the nameservers from there to point to the new ones.
Update - I have recently moved my website to a Linux server from a Windows 2003 Server and at the same time I took the DNS settings away from the webshost and use Zoneedit's nameservers instead. I found the interface very easy to use and managing my DNS setting from there has been very easy. If I were able to use their nameservers for bobpeers.dk then I would do so, but that's not possible as I explain at the bottom of the page. I should note that the first 5 domains on Zoneedit are free.
Setting up DNS records
Now you need to log into the control panel of the web host using the address and password they supply. Once in go to the DNS settings and check all the records you need are there OK, by default they should be filled in with the correct into already. Here is a quick run-down of some of the records you need.
A record -> this is the record that a browser looks up when you type the address in the address bar. When you type www.bobpeers.com the browser goes to the nameserver for bobpeers.com and asks for the A record. This record must point to an IP address, this will be the IP address of your web server. I would recommend adding at least 4 A records:
You can add as many A records as you like, for example if you add an A record called news and point it to the IP of the bbc.co.uk website then a visitor to http://news.example.tld will be presented with the front page of the bbc.co.uk news website, however your domain will remain in the address bar.
MX records -> these are the records that control how mail is sent to your domain. You should ideally have at least 2 MX records for your domain so that if the 1st is inaccessible mail will be sent to the backup, otherwise there is a chance that emails sent to you will bounce back.
They should always point to the mail servers name NOT the IP address, if you enter an IP address you may lose mail. They also need a preference to be set, this just determines in which order the records should be used.
The record with the lowest preference number will be tried first followed by next lowest and so on. The numbers can be any positive number but it's normal to use 10, 20, 30 and so on. It is not recommended to start with 0 as some mail servers have a problem with this. They should be entered in the form of:
Checking your settings
After entering the data it's a good idea to check that you have done this correctly, there are some websites that allow you to check your DNS setting are correct. One of the most popular is DNSstuff.com, especially useful is the DNSreport which tests all of your DNS setting and reports any problems. Another useful site is CheckDNS.net which produces a similar report.
Another useful tool to get DNS data is to use the nslookup program on any windows machine. Simply open a command prompt and type nslookup, at the > prompt type your domain and it will return your DNS setting as reported by the nameserver. You can also just return selected records by typing set type=mx or a or whatever you want at the prompt then hit enter and enter the domain name again, this will now just return the records you request.
Below is an example of the output you can expect from the program.
C:\Documents and Settings\bob_user>nslookup
Default Server: frederik.ingolf.dk
Address: 172.16.0.1
> set type=all
> bobpeers.com
Server: frederik.ingolf.dk
Address: 172.16.0.1
Non-authoritative answer:
bobpeers.com
primary name server = ns13.root-name-server.net
responsible mail addr = hostmaster.bobpeers.com
serial = 2004010540
refresh = 3600 (1 hour)
retry = 900 (15 mins)
expire = 604800 (7 days)
default TTL = 14400 (4 hours)
bobpeers.com internet address = 216.7.186.183
bobpeers.com MX preference = 20, mail exchanger = in2.smtp.messagingengine.com
bobpeers.com MX preference = 10, mail exchanger = in1.smtp.messagingengine.com
bobpeers.com nameserver = ns14.root-name-server.net
bobpeers.com nameserver = ns13.root-name-server.net
bobpeers.com nameserver = ns13.root-name-server.net
bobpeers.com nameserver = ns14.root-name-server.net
ns13.root-name-server.net internet address = 216.7.186.181
ns14.root-name-server.net internet address = 216.7.186.182
To get the same information on a Linux machine you can use dig. Below is a sample of it's use to get the same data as above. (Note that the data returned is actually different due to me moving web hosts between the two outputs, but the mx records are the same).
$ dig bobpeers.com ANY ; <<>> DiG 9.3.2 <<>> bobpeers.com ANY ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35553 ;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 2, ADDITIONAL: 1 ;; QUESTION SECTION: ;bobpeers.com. IN ANY ;; ANSWER SECTION: bobpeers.com. 7192 IN MX 0 in1.smtp.messagingengine.com. bobpeers.com. 7192 IN MX 5 in2.smtp.messagingengine.com. bobpeers.com. 3815 IN A 69.93.251.68 bobpeers.com. 3608 IN NS ns17.zoneedit.com. bobpeers.com. 3608 IN NS ns3.zoneedit.com. ;; AUTHORITY SECTION: bobpeers.com. 3608 IN NS ns17.zoneedit.com. bobpeers.com. 3608 IN NS ns3.zoneedit.com. ;; ADDITIONAL SECTION: ns17.zoneedit.com. 18189 IN A 209.126.159.118 ;; Query time: 3 msec ;; SERVER: 172.16.0.5#53(172.16.0.5) ;; WHEN: Thu Jul 27 19:37:18 2006 ;; MSG SIZE rcvd: 197
This is how my DNS records are set up for bobpeers.com, note how my MX records point to messagingengine.com, this is because I use Fastmail.fm to handle my email. I have also set up an A record mail.bobpeers.com to point to 66.111.4.55 which is one of the IP addresses of fastmails servers (the other is 66.111.4.56).
Therefore if I visit mail.bobpeers.com I also get to the fastmail login page. The other use of this setting is that I can set up my email client to use mail.bobpeers.com as my outgoing smtp server on port 25.
@ MX [0] in1.smtp.messagingengine.com. @ MX [5] in2.smtp.messagingengine.com. @ A 69.93.251.68 * A 69.93.251.68 ftp A 69.93.251.68 mail A 66.111.4.55 www A 69.93.251.68
Notes on the .dk TLD
I have also bought bobpeers.dk from a company called BuyDomains.dk. To get a full list of approved registrars of the .dk domain see DK Hostmasters (English or Dansk) site.
Note that the prices charged by different companies seem to vary enormously, for example I paid 139DKK to register my domain for 2 years while the same domain from Cybercity would have cost 300DKK for one year.
Things are also slighly different for .dk domains because you cannot just change the nameservers to any nameserver. The controller of the .dk TLD, a company called DK Hostmaster (English or Dansk) has a list of approved nameservers, you can test if a nameserver is approved here (English or Dansk).
In my case, since my website is hosted in the USA, their nameservers are not on the approved list so I had to use the DNS facility provided by BuyDomains.dk.
A free option if you have already bought your .dk domain is to use GratisDNS.dk, they charge nothing for you to transfer your domain to them and DNS hosting is free too.
Update- since I wrote this I now see that ZoneEdits' nameservers are now on the approved list from dk-hostmaster so it is now possible to delegate your nameservers and use ZoneEdit to control all your DNS settings.
Also note that most web hosts only allow you to host 1 domain, so in order for bobpeers.com and bobpeers.dk to resolve to the same site I just added an A record to bobpeers.dk pointing to the web host and then added a domain alias of bobpeers.dk in the web hosts settings. By doing this when a request for bobpeers.dk is sent to my web host the server knows to send the same pages as when a request to bobpeers.com is made.







