1

I'm trying to create a service like adding custom domain on blogging sites:

1) Customer changes some settings on his domain.
2) When customer's user comes to customerdomain.com, in fact, he sees the contents of mywebsite.com/customers_id. I think it should be DNS A Record, or something like this, but unfortunately, I have too little experience in system administration.

What exactly does the customer have to do with his domain settings?

2 Answers 2

1

The customer needs to create a CNAME record that points to the A record of your server. Beyond that, you'll need a vhost that serves requests for all these domains, and application code that is able to serve each domain's content properly.

4
  • And if this CNAME record would be with a path like mydomain will be a correct CNAME record with the path? Jul 17, 2013 at 2:29
  • I thought СNAME applies only to third-level domains, isn't it? Jul 17, 2013 at 2:31
  • DNS records don't have paths.
    – EEAA
    Jul 17, 2013 at 2:31
  • And are there other ways to implement it? Jul 17, 2013 at 2:33
1

On the customer side this is a DNS entry. There are two options:

  • Create an A record for the domain (example.com) or sub-domain (www.example.com). The IP address must be your web server's IP address. If you scale up to multiple servers, additional A records can be used. (The customer will need to do this.)
  • Create a CNAME for the sub-domain (www.example.com) pointing to your domain. This solution does not work for a domain that has additional records such as NS records. As a result any domain that uses a CNAME can not have additional record types (and services) such as MX, TXT, SPF, etc. When a CNAME is used you have better control over which IP address(es) are used.

The above options handle what the customer needs to do. On your side you need to configure your web server to handle requests for www.example.com. There are several options:

  • Redirect the to a path on yoursite such as www.example.net/example. Mapping paths can become complex quite rapidly.
  • Redirect the customer to a subdomain on your site such as example.example.net
  • Create a virtual host for the customer (which is commonly done). Often requests for example.com get redirected to www.example.com or vise versa.
  • Create a host with its own IP address for the customer. (Likely only practical for an IPv6 only site.)

Neither of the first two options can be achieved by DNS. The last only requires that DNS gets you to your site. Only in the last case can you handle requests for the customers site which arrive without a host header. You don't say which web server software you plan to use. The Apache web server documentation covers the above setups quite well.

2
  • Do I understand correctly that I can not implement it with domaint paths? I mean, I can not create a link to subdirectory of my domain like mydomain.com/customers_id? Jul 17, 2013 at 2:38
  • @user1858864 I've added your side of the mix. If you don't understand either side, you have a lot to learn. There are numerous providers out there that already provide this kind of service. However, if you have a niche market you may be able to make a go of it.
    – BillThor
    Jul 18, 2013 at 0:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .