Creating DNS records

Creating DNS records for your domain is easy to do within the Slicehost Management Panel.

In this article we will look at creating a DNS zone for your domain and adding basic A and NS records using the SliceManager interface.


Login

Perhaps unsurprisingly, the first thing we have to do is log into the SliceManager which can be found at https://manage.slicehost.com.

DNS Panel

Once logged in, click the DNS tab were you will be faced with this:

New Domain

Click the 'new domain' link and enter your domain name.

Note: This does not create a record (you may be used to the 'old' SliceManager). It is only the title of the zone records. We still need to create records.

Records

Once done, click on 'records' next to your domain name.

As mentioned, there are no records yet:

Let's go ahead and add the domain A records.

A Records

We'll start with the basics and add an 'A' record for the domain (mynewdomain.com) and for a 'www' subdomain so users can navigate to the site using 'www.mynewdomain.com'.

Click on 'New Record'. You will notice a drop down box that shows the types of records that are available:

Make sure 'A' is selected and then fill in the details for your domain.

In my case I used the following:

Name: mynewdomain.com. (Note the period '.' at the end of the full domain).

Data: 208.75.84.20

Ensure you input the correct IP address for your Slice.

Repeat the process but use 'www' for the Name. When using subdomains, there is no need to enter a period '.' at the end of the record. So the details would be:

Name: www

Data: 208.75.84.20

NS Records

One things that is often missed and is a requirement if you are to set up your domain records 'correctly' are the domain's NS records.

These are not the same as the records you set with your domain registrar.

If you have not set those main NS records, you will still need to do so.

Following the same procedure as with the A records, click 'New Record' and ensure that 'NS' is selected from the drop down box.

I used the following values:

Name: mynewdomain.com. (Note the period '.' at the end of the full domain).

Data: ns1.slicehost.net. (Note the period '.' at the end of the full domain).

Repeat this for each of the main NS records your created with your domain. For most domains this will need to be done for ns1.slicehost.net, ns2.slicehost.net and ns3.slicehost.net.

However, some registrars only allow for two NS records for a domain. For example, one of my .co.uk. domains only has ns1 and ns2.slicehost.net so I would only put those two records here.

Done

Once done, the five records we created will look something like this:

Naturally, your records will be for your domain and your Slice IP address.

Feel free to add as many records as you need.

Summary

Creating a DNS zone and adding DNS records is very easy with the SliceManager.

The next articles will concentrate on setting up reverse DNS and looking at MX (Mail Exchange) records.

PickledOnion.

Article Comments:

Daniel Lucraft commented Fri Nov 09 09:30:33 UTC 2007 ago:

Hi there is a typo above where you have put n2.slicehost.net rather than ns2.

I wouldn't mention it except that I have twice now cut and pasted it into my registrars settings field!

best, Dan

PickledOnion commented Fri Nov 09 09:35:46 UTC 2007 ago:

Daniel,

Thanks. Always feel free to let me know of typos and other mistakes!

I have changed it.

Once again, thanks,

PickledOnion.

Bovn commented Thu Dec 27 21:57:21 UTC 2007 ago:

A tip is to use the command nslookup in the terminal after fixing with the DNS. You should then see an arrow which means that you can type in the url to your domain. The response will then be the IP address that the domain is linked to. If that is your slice ip-address then you have succeeded.

PickledOnion commented Fri Dec 28 11:00:12 UTC 2007 ago:

Bovn,

Thanks for the tip.

However, you may be better off using the 'dg' command as outlined in this article: http://articles.slicehost.com/2007/10/8/introduction-to-dig

That way, you can check the records before they are propagated, which is quicker than waiting for the record to propagate to see if it has been entered correctly.

PickledOnion.

Robert Gonzalez commented Fri Jan 04 17:41:07 UTC 2008 ago:

Thanks for the great tutorial. This worked out of the box as expected. I had a domain routing in minutes. Awesome. Thanks again.

Kevin Chiu commented Sat Jan 12 05:44:53 UTC 2008 ago:

So, if I get a second domain, do I just do the same procedure and make a duplicate www record, or is there something I'm missing here?

Colin Z commented Sat Jan 12 20:55:20 UTC 2008 ago:

The registrar for my domain is Yahoo. I've changed my name servers on their end to be ns1.slicehost.net.

Do I need to also change any of the other records on their end, such as A or CNAME? Or will they basically be ignored since I set slicehost as my nameservers?

PickledOnion commented Mon Jan 14 12:41:57 UTC 2008 ago:

Kevin,

You would go through the whole procedure for each domain you have - so add a 'zone' and add each DNS record that the domain needs.

Colin,

Once you set the main nameservers to point to Slicehost, all record queries will be made at the Slicehost nameservers.

PickledOnion

gmelton commented Wed Jan 16 18:13:38 UTC 2008 ago:

This little tutorial is great!

When I got to work today my personal domain name is not reachable over my corp network. I can reach my IP directly. This leads me to believe that I might be missing something somewhere. Logic tells me it has something to do with DNS but I have no idea where to start.

Has anyone else seen this problem?

gmelton commented Wed Jan 16 18:31:11 UTC 2008 ago:

Alright, I think I have the answer to my own question (hi-five self!):

http://articles.slicehost.com/2007/10/8/introduction-to-dig

hmart commented Sun Jan 20 03:35:31 UTC 2008 ago:

I want to recommend the DNS HOW TO.

A must for a sysadmin!

Harish commented Mon Jan 21 02:22:48 UTC 2008 ago:

Suggestion: DNS Zone Templates?

John commented Wed Jan 30 07:02:26 UTC 2008 ago:

I want to make a blog subdomain that points to a wordpress directory. Do I make a A record or CNAME record? I can't figure this out. I made a blog.mysite.com and a2ensited it. But it is redirecting to www.mysite.com instead.

PickledOnion commented Wed Jan 30 10:30:45 UTC 2008 ago:

John,

You can create either - I would recommend an A record pointing to the IP as it only requires one request.

As such, follow the same procedure as for the 'www' example above but use 'blog' instead.

If you have issues once the record is created (and has been propagated) then it will be an problem with the vhost file and not the record itself.

PickledOnion

John commented Wed Jan 30 18:34:44 UTC 2008 ago:

Thanks for the quick response. I have it working as an A record. I've changed so many things, I'm not sure what was the problem:) But it seems to be working now. Thanks!

Bliss commented Thu Jan 31 05:01:04 UTC 2008 ago:

Thanks for the article. It made setting DNS entries so easy. But this is too easy isn't it? Is there any check done at the main registrars for the host/IP address? I can type in google's name and my IP address and get all the traffic in the world ;-)

Ben commented Sun Feb 17 20:38:26 UTC 2008 ago:

Is there any way to do wildcards for subdomains? I want to catch all subdomains and point them to an app that uses that to determine the account.

Ben commented Sun Feb 17 20:51:58 UTC 2008 ago:

I found my own answer now ... *.domain.com. as an A record ... the period on the end is important

Jeff commented Fri Feb 22 14:31:08 UTC 2008 ago:

Can anyone give me a clue how/where to configure the MX records related to my domain? This is what I was told to do. I just don't see where/how to do it. Thanks....

Required: mx0 - smtp.secureserver.net mx10 - mailstore1.secureserver.net

Optional: cname - mail.yourdomain.com mapped to pop.secureserver.net (required for Outlook or other Email Client)

cname - email.yourdomain.com mapped to email.secureserver.net (required for webmail shortcut)

PickledOnion commented Fri Feb 22 14:48:05 UTC 2008 ago:

Jeff,

Have a look at the articles tagged with dns:

http://articles.slicehost.com/tags/dns

There are a couple on MX records, including the 'creating an MX Record' which sounds as if it will help.

PickledOnion.

David commented Sat Mar 01 06:13:55 UTC 2008 ago:

Thanks so much for the outstanding articles. I hope that I haven't missed this already discussed, but I was wondering if there is any benefit to having control of the DNS relinquished to the Slicehost DNS servers?

I currently use a number of shared webhosts (I have a 256 slice, but still learning) and find that it is less of a hassle to switch email and such to different hosts if it is all managed in one place. Is this not good practice?

PickledOnion commented Mon Mar 03 12:30:33 UTC 2008 ago:

David,

I prefer keeping my DNS records in one place as I have domains from several registrars.

there is no technical reason to do so. entirely up to you.

PickledOnion

Roderik commented Tue Mar 04 06:17:20 UTC 2008 ago:

Hello,

I want to host another domain on my slice. But when I try to add the domain in the dns table I get the following error:

Origin is invalid

The domain is registered and the nameservers are set. Am I supposed to add the records of this new domain to the records of the old domain? I can't find anything on this error either on the web.

Edward S. Marshall commented Fri Mar 14 14:23:27 UTC 2008 ago:

Feature request: one more action at the domain level (next to records|edit|delete) to download the zone in a bind-compatible format (translating to the someone's favorite format could be left as an exercise to the user grin). It's important to be able to back this up, especially with more involved zone configurations. (I didn't see a provision for doing zone transfers anywhere, but being able to do an AXFR of the data from our slices would also solve the problem nicely).

Another nice-to-have would be displaying priority next to MX and SRV records in the record editing screen; unless the hostname or srv data give an indication of priority, you're not sure which entry is which until you click on it. :-)

Otherwise: nice interface! Beats some of the other webby frontends I've seen to DNS before. Adding the IP addresses of your slices at the bottom of each editing screen is a nice touch. :-)

Nuri commented Mon Mar 31 13:08:10 UTC 2008 ago:

I didn't get why should (or not) i use DNS Records?

jsnod commented Tue Apr 01 20:19:38 UTC 2008 ago:

Would it be possible for you to update the SliceManager DNS tool to allow sorting by column? EG: click the 'Data' column header, and it sorts all entries by the Data field.

Vaibhav commented Sat Apr 05 14:29:50 UTC 2008 ago:

At the registrar's end, I need to change just the DNS records - right?

Tiago Faria commented Sat May 03 18:15:14 UTC 2008 ago:

I usually create a CNAME record pointing *.domain.com to domain.com.

Just to make sure, in case there is a typo in a sub-domain, for example, people still get directed to my main domain.

Vidmantas commented Thu Jun 12 10:25:52 UTC 2008 ago:

Hi, is there a way to do this in the console? I wrote myself vhost management script and it would be great to have an option to update/create DNS records too.

PickledOnion commented Thu Jun 12 10:33:28 UTC 2008 ago:

Vidmantas,

You can use the API:

Slicehost Articles: SliceManager API Documentation

PickledOnion

Jason commented Mon Jun 16 15:58:56 UTC 2008 ago:

I'd like to second the suggestion for zone templates. I like that the DNS management interface is simple, but it's a real pain to have to click around so much to add these entries over and over.

An alternative is to allow batch input of records, which would also make it a lot easier to manage multiple records.

Anyway, thanks for the article.

lyrix commented Wed Jul 02 15:16:44 UTC 2008 ago:

I used 1and1 for my domain registration and simply pointed the A record of a subdomain www.mydomain.com to my IP provided by slicehost.

This seems to work, but i am not sure if I am missing something?

One thing i'd like to have is the good looking email address to receive emails, such as lyrix@mydomain.com, in this case, i probably should leave the A record of mydomain.com to 1and1 and use their email service?

Sorry i am really new to the whole website administration process

wuputah commented Wed Jul 30 22:59:34 UTC 2008 ago:

It might be a stretch, but if your backend is bind-style zone files, it would be nice for those of us comfortable working with those to directly modify the file. It would be much faster than using the user interface (I'm not putting down your interface - after using a myriad of DNS interfaces, I've found the best is the original - a text file). A link that says "edit the zone file (advanced users only)" at the top of the "Records" page would suffice.

Jason commented Thu Jul 31 23:45:08 UTC 2008 ago:

How do you feel about CNAME usage instead of A records for www subdomains? Pros? Cons?

For Example:

example.com. A 209.50.50.12 www CNAME example.com.

PickledOnion commented Fri Aug 01 09:42:20 UTC 2008 ago:

Jason,

Advantage of cnames is that it is easier to change the DNS records as you only need to change 1 record and the www subdomain will be changed via the cname.

Disadvantage is that it takes two requests to the get the information, one to 'www' which then has to reference the main domain.

My personal opinion is A records are better - the tiny issue of time saved if changing an IP (how often do you change a domain IP?) compared to doubling the lookups for each requests makes cnames inferior.

Note that is just my opinion and some people swear by names.

PickledOnion

giacomo commented Fri Aug 08 10:13:09 UTC 2008 ago:

Hi, is there a way to have a single IP reverse-resolved to many hostnames/domains? Since I have more than one domain, I also need to have direct/reverse lookup for the host "mail":

dig mail.domain1.com ---> 209.x.y.z dig mail.domain2.com ---> 209.x.y.z

(this is easily done by setting up each domain zone separately as described above)

dig -x 209.x.y.z ---> mail.domain1.com ---> mail.domain2.com

As far as I can see, I can only specify one domain in the "reverse DNS" setup.

Martin Evans commented Fri Aug 08 15:14:09 UTC 2008 ago:

How do you setup if you just want to alias a domain i.e name.co.uk aliased to name.com

Want to comment?


(not made public)

(optional)

(use plain text or Markdown syntax)