Find the answer to your Linux question:
Results 1 to 9 of 9
I have a domain that I host myself on my webserver and I do my own DNS. It is a .net we will call it mydomain.net I also own mydomain.com. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer adrenaline's Avatar
    Join Date
    Aug 2004
    Location
    Seattle, Washington
    Posts
    1,058

    DNS Mydomin.com + .net


    I have a domain that I host myself on my webserver and I do my own DNS. It is a .net we will call it mydomain.net I also own mydomain.com. Currently mydomain.com is doing nothing but I would like it to default to mydomain.net without using another IP address. I am not quite sure how to do this. I do host my own DNS so if that is a way of doing it I can do it I am just not sure how. Just to reiterate what I want is if you lookup www.mydomain.com or www.mydomain.net it will go to my www.mydomain.net website.

    Any Ideas?
    Thanks,
    Mike
    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

  2. #2
    Linux Enthusiast
    Join Date
    Jun 2002
    Location
    San Antonio
    Posts
    621
    You can't do this through DNS. However, you don't really want to. If you are just looking at doing webserving for both domains from the same folder, edit your httpd.conf, and add a ServerAlias directive. It would read:
    Code:
    ServerAlias www.mydomain.net mydomain.com www.mydomain.com
    Where your ServerName is mydomain.net. Then you can make your DNS point both zones to the same IP, and apache will figure out which domain is which by the HTTP headers it sends.

    Best,

    Samuel
    I respectfully decline the invitation to join your delusion.

  3. #3
    Linux Engineer adrenaline's Avatar
    Join Date
    Aug 2004
    Location
    Seattle, Washington
    Posts
    1,058
    Do I still need to do a zone and forward and reverse lookup for the .com or can I just edit the httpd.conf file?

    Mike
    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

  4. #4
    Linux Newbie
    Join Date
    Apr 2004
    Posts
    158
    Hi,

    You can do this via DNS,

    All you need is a CNAME to www.mydomain.com from www.mydomain.net

    That would make any person trying to surf to www.mydomain.com end up at www.mydomain.net's ip-address (depending on your apache config, you could run separete web-sites or one site as described above)

    That is if your DNS is serving the internet.

    If you need some DNS hosting look at www.no-ip.com.

    look at Virtual hosting on the www.apache.org site for more information about running multiple web-sites on the same server.

    Cheers

    Jonas
    --
    in Linux Computing we Trust

  5. #5
    Linux Engineer adrenaline's Avatar
    Join Date
    Aug 2004
    Location
    Seattle, Washington
    Posts
    1,058
    Quote Originally Posted by cjl7
    Hi,

    You can do this via DNS,

    All you need is a CNAME to www.mydomain.com from www.mydomain.net

    That would make any person trying to surf to www.mydomain.com end up at www.mydomain.net's ip-address (depending on your apache config, you could run separete web-sites or one site as described above)

    That is if your DNS is serving the internet.
    My DNS is serving the internet. Can you be a little more specific about the cname?
    Do I need a zone file for www.mydomain.com and a forward reverse lookup.?
    or can I do like wassi said and alias it in the httpd.conf file and be done with it?

    thanks
    Mike
    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

  6. #6
    Linux Newbie
    Join Date
    Apr 2004
    Posts
    158
    Hi,

    No it is now enough to edit the httpd.conf file, people (like me) needs to be able to find out where www.mydomain.com is -> DNS lookup...

    In your main file for www.mydomain.net you have an alias for www, ftp and so on, right?

    In there you put the following;

    www.mydomain.com IN CNAME www.mydomain.com

    This assumes that www.mydomain.com is something that your DNS knows about.

    Reload the DNS and check with
    Code:
    host www.mydomain.com
    Let me know if anything is unclear!

    //jonas
    --
    in Linux Computing we Trust

  7. #7
    Linux Engineer adrenaline's Avatar
    Join Date
    Aug 2004
    Location
    Seattle, Washington
    Posts
    1,058
    Quote Originally Posted by cjl7
    Hi,

    In your main file for www.mydomain.net you have an alias for www, ftp and so on, right?

    In there you put the following;

    www.mydomain.com IN CNAME www.mydomain.com

    This assumes that www.mydomain.com is something that your DNS knows about.

    Reload the DNS and check with
    Code:
    host www.mydomain.com
    Let me know if anything is unclear!

    //jonas
    I will try this and let you know.
    Thanks for the advice.
    Mike
    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

  8. #8
    Linux Engineer adrenaline's Avatar
    Join Date
    Aug 2004
    Location
    Seattle, Washington
    Posts
    1,058
    Jonas,
    That didn't work, I was a little unclear about your cname deal
    www.mydomain.com in cname www.mydomain.com

    I tried it both ways
    www.mydomain.net in cname www.mydomain.com
    www.mydomain.com in cname www.mydomain.com

    neither worked.

    Do i need to create a zone too and if I do it your way what do I do about reverse lookups?

    Mike
    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

  9. #9
    Linux Engineer adrenaline's Avatar
    Join Date
    Aug 2004
    Location
    Seattle, Washington
    Posts
    1,058
    Jonas,
    I created a zone file and it worked. I also copied my .net db file to .com so I have to db files one for .net and one for .com but the .com looks exactly like the .net and it worked. Thanks for your advice.

    Cheers,
    Mike
    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •