Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I'm using some fictional IP addresses here, but the problem is real.

My default A Record:

* # this is for anysubdomain.example.com, I suppose
@ # and this is for example.com
www # this is for www.example.com

There are also these entries. What do they do in this context? My MX records are elsewhere.

mail
webmail
pop
smtp

Now I'd like to point to my own server. Let's say that my IP is 1.2.3.4 I would then write:

* 1.2.3.4
@ 1.2.3.4
www 1.2.3.4

Is that correct? I read something about * IN A 1.2.3.4 - what's that notation?

Assuming my application runs on 1.2.3.4:80, everything should be fine, right? I am new to the A records concept and I'd like to ask before changing and deconstructing my system.

share|improve this question
1  
Example IP addresses. –  TRiG Jan 16 at 16:13

1 Answer 1

up vote 2 down vote accepted

If I understood correctly, you want your root domain (aka example.com) to resolve to 1.2.3.4. In this case, all what you have to do is to create an A record that points to that IP

example.com A 1.2.3.4

depending on your DNS hosting interface, you may either need to leave the record name empty (to match example.com) or other providers asks you to reference it with @. In that case

@ A 1.2.3.4

If then you also what the www hostname (aka www.example.com) to map to the same server, you can either add another A record

www A 1.2.3.4
# or depending on your DNS hosting interface
www.example.com A 1.2.3.4

or a CNAME to the root domain

www CNAME example.com
# or depending on your DNS hosting interface
www CNAME @

The wildcard records *.example.com allows you to map any subdomain of a specific level to a server. For instance

*.example.com A 1.2.3.4

will map any one-level subdomain of example.com (including www.example.com but not example.com root domain) to that IP. It also works with a CNAME

*.example.com CNAME example.com

You should avoid wildcards unless you really need it, for instance for a subdomain-based multi-tenant application

Note. In my examples I always use the format

DNS NAME - RECORD TYPE - CONTENT

but how you create those records and the order of the items depends on your DNS hosting provider interface.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.