Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Say that I have a domain name called example.com and two server located at 2 different IP addresses: and

How could I assign example.com to and the subdomain foo.example.com to

[EDIT] I did try to put a A record linking from @ to the first IP address and from foo.example.com to the second IP address, as illustrated below:

enter image description here

And I did configure a vhosts called foo.example.com on my server at IP address 2.

The @ record works. But after 3 hours waiting for the result (DNS delay), nothing happened with foo.example.com, which link to nothing. Why?

share|improve this question
If you need to debug your setup, use command line ping to see that you are hitting the correct IP address. If the DNS isn't working yet, put the IP address in your hosts.txt file (or /etc/hosts) and test your server setup before the DNS goes through. – Stephen Ostermiller Nov 4 '13 at 17:39

You will need to edit the "domain name system" (DNS) records for your domain and assign two A records: one for the bare domain, and one for the subdomain. In DNS, A records are used to assign IP addresses to domain names (and subdomains).

The specific mechanics of editing your DNS records is going depend on where your DNS records are hosted. My DNS host gives me a web interface that lets me do this:

DNS A record web interface

share|improve this answer
thank you for your help, however it does not works – Guillaume Pierre Nov 4 '13 at 16:31

Your Answer


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.