How to create an alias for a website in DNS?

???

Mateusz

Posted on Oct 21, 2005 6:28 PM

Reply
13 replies

Oct 23, 2005 5:04 PM in response to Mateusz Rajca

Then what you're asking for is a redirect, nothing to do with aliases at all.

You need to be more specific about how you want the redirects to work. For example, do you want the redirect to maintain the same URI (so that a request to http://alias1.com/some/path.html redirects to http://domain.com/some/path.html (i.e. maintaining the same relative path)?
If so, that is best done by a rewrite rule in the apache config. This doesn't need Mac OS X Server, but it does need some understanding of Apache's Rewrite rules.

Oct 24, 2005 6:01 PM in response to Mateusz Rajca

Then what you're asking for is a redirect, nothing to do with aliases at all.
You need to be more specific about how you want the redirects to work. For example, do you want the redirect to maintain the same URI (so that a request to http://alias1.com/some/path.html redirects to http://domain.com/some/path.html (i.e. maintaining the same relative path)?
If so, that is best done by a rewrite rule in the apache config. This doesn't need Mac OS X Server, but it does need some understanding of Apache's Rewrite rules.


Can you post the specific directive.

Oct 24, 2005 6:01 PM in response to Mateusz Rajca

Well, depends on how you define alias.

You said this:
"Thanks but that's not what I wanted. What I really want is that a user types for example alias1.com and it will redirect them to domain.com. How can I make this happen?"

If that's the case, then you have to register alias1.com as another domain.

If you mean something like:
alias1.domain.com
then no, you don't have to register another domain because alias1 is a subdomain of the domain.com domain.

Anything at the top level (actually one level down, as the Top Level Domains are .com, .org, .net, etc) (ie foo.com, bar.com, test.com, blah.net, glad.org, etc) will have to be registered as a domain through a valid registrar.

Oct 24, 2005 6:08 PM in response to Mateusz Rajca

The alias needs to be in your domain name server's records. If you registered "example.com", and you wanted your web server to respond to "www.example.com" as well as "example.com", then you would need to add an alias (CNAME) record in your domain name server for "www" to point to the domain name (or to a server's name).

When you have registered a domain name, you can usually create whatever subdomains or node records you like (therefore "www.example.com", "n001.example.com", "server.example.com" could all be created by you to match names of devices on your network; subdomains require separate zone entries in your name server, but providing you own the top domain, everything to the left of the domain name is yours too (thus www3.toronto.example.com and ns1.ottawa.example.com might be possible, depending on your name server)).

The next step is to tie a domain name (which is required for users to find your service on the internet) to the web server. In Server Admin, you can tie aliases to the same IP address so that the web server answers to both. Or you could specify that different domain names go to different web sites on the same web server.

Does this all make sense?

Oct 24, 2005 8:05 PM in response to Mateusz Rajca

Mateusz,

You said "sort of". I want to make sure you understand this, because you have about 5 different threads going that all stem from your misunderstanding of DNS and how top-level domains work, aliases, etc.

If you want to have domain1.com and domain2.com point to the same website, you need to purchase both domain1.com and domain2.com from a registrar. You then set up both domains to point to the same web server using your registrar's DNS administration tools. You also don't need to worry about setting up BIND, because the primary and secondary DNS servers for the domains you just purchased will be managed by the registrar you purchased the domains from.

If you want to have subdomain.domain1.com point to domain1.com, this is all handled in the DNS tools of the registrar where you purchased the domain. The only time you have to worry about Virtual Hosts in the httpd.conf file is if you want to serve multiple websites from your single computer. Otherwise, just setup Apache to listen to port 80, don't specify an IP address or host name in the config, and make sure your router is port-forwarding port 80 from the external interface to the internal IP address of your computer.

There's no need to get Mac OS X server for what you want.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to create an alias for a website in DNS?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.