Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

DNS question...

Options
  • 17-06-2001 7:56pm
    #1
    Business & Finance Moderators, Entertainment Moderators Posts: 32,387 Mod ✭✭✭✭


    I'd like devore.boards.ie to go to a script that would redirect it to www.boards.ie/members/devore

    I mean, I'd like this for ALL members even if their accounts are not set up yet.

    I think this has something to do with CNAMEs (?) but to honest I know little about the workings of DNS. I've seen something like this dont before on joke sites. Anyone know how to do it for a website?

    Think about it, wouldnt it be cool to have amp.boards.ie or castortroy.boards.ie as your web addy...

    DeV.


Comments

  • Closed Accounts Posts: 649 ✭✭✭The Cigarette Smoking Man


    I think that's done by pointing all the domains to a webserver and using http headers to redirect to another page. A CNAME record is just an alias for another record and I don't think it will redirect to a url.


  • Moderators, Category Moderators, Technology & Internet Moderators Posts: 6,265 CMod ✭✭✭✭MiCr0


    afaik
    dns is just for pointing towards differnet ip addresses or different names
    so if all users had unique ip's then dns is the way to go.
    if b.ie is hosted on iis can't u just set-it-up there?

    [info]
    CNAME records are "canonical name" records. DNS allows machines to have a true (canonical name), as well as an unlimited number of aliases. The CNAME record takes care of aliases. These should only be used when absolutely necessary, unless you are very familiar with DNS, since they can cause lots of problems if not used properly.


  • Closed Accounts Posts: 65 ✭✭wintermute



    Two steps are required for this:

    1. Edit the DNS zone database file for "boards.ie" and enter in a CNAME reference for "devore" and point it to your webserver.

    2. Tell your webserver that you want to turn on a feature called "server-side virtual hosting" Then you need to set up a website called "devore.boards.ie" on the webserver.

    So, when people point their HTML clients to devore.boards.ie the CNAME record in DNS directs it to the IP of your webserver. Then, your webserver sees "devore.boards.ie" in the HTTP header and serves back the virtual site you set up.

    If you want to point to "www.boards.ie/members/devore" then simply tell your webserver to redirect requests for your virtual site to that address.


  • Registered Users Posts: 1,562 ✭✭✭Snaga


    First all of the hosts have to be set up as an alias to your main domain. These are the CNAME entries to the zone file....

    so itd be like

    www IN CNAME 216.247.239.48
    snaga IN CNAME 216.247.239.48

    etc.....

    then create a file, ex. members.conf and populate it with all of the subdomains like this...(taken and modified from a working file)

    <VirtualHost 216.247.239.48>
    DocumentRoot /home/members/snaga/public_html/
    ServerName snaga.boards.ie
    ScriptAlias /cgi-bin/ "/home/members/snaga/public_html/cgi-bin/"
    </VirtualHost>

    Then include this file at the bottom of your httpd.conf.

    (apologies it took so long to write this and other ppl replied in the mean time and the fact that its tailored for apache webserver which may not be any use to you)

    [This message has been edited by Snaga (edited 17-06-2001).]


  • Business & Finance Moderators, Entertainment Moderators Posts: 32,387 Mod ✭✭✭✭DeVore


    Thanks guys, what you say will work for Devore but not for a new user we've never heard of before...

    What I'm looking for is some way to send ALL xxx.boards.ie traffic to the front page (or wherever) and then we'll write a script to work out where to send them onwards to...

    its getting the xyz.boards.ie to go to somewhere we can have a script waiting for the visitor thats the problem...

    DeV.


  • Advertisement
  • Registered Users Posts: 1,562 ✭✭✭Snaga


    If you run your own dns server you could hack the ubb source to make the changes for you as a member adds themselves, but as you said its probably not suitable for what you want.


  • Closed Accounts Posts: 296 ✭✭moist


    <font face="Verdana, Arial" size="2">Originally posted by DeVore:

    What I'm looking for is some way to send ALL xxx.boards.ie traffic to the front page (or wherever) and then we'll write a script to work out where to send them onwards to...
    </font>

    I think I get what you want.
    You just want to stick somthing into your dns so that without having to maintain it, so user_that_does_not_exist.boards.ie will have
    the same A record as www. I have never heard of such a thing, though it _may_ be possible.
    However it may be difficult to persuade IOL to do it smile.gif

    One thing you could do though, is to transfear the DNS from IOL and host it yourself, then when new users register
    you automaticly add a CNAME for them to DNS.
    Twould be very easy to script in 'NIX, though you would have to be pretty careful with checking names...
    <font face="Verdana, Arial" size="2">
    its getting the xyz.boards.ie to go to somewhere we can have a script waiting for the visitor thats the problem...
    </font>

    That would be easy once you got the above working.
    If there is no VirtualHost directive (or IIS equilivant) for the hostname (moist.boards.ie)
    you will be given the default page, (what is shown if you just put in the IP address (though on 216.247.239.48 its "The system cannot find the file specified." tongue.gif ))

    Then you can take the "Host" attribute from the HTTP Headers, and your away....


  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    An example in Apache, using PHP as the scripting language:

    Set up a VirtualHost with a dedicated IP address:
    NameVirtualHost 111.222.333.444
    &lt;VirtualHost 111.222.333.444&gt;
     ServerName redirect.boards.ie
     DocumentRoot /path/to/docroot
    &lt;/VirtualHost&gt;
    

    Alternatively, you could use a current IP address, setting the first VirtualHost as the redirection engine. This will screw up users without HTTP/1.1 browsers, but who cares about them any more? Now set up the PHP script:
    &lt;?
    
    // The Host header can be UC or LC, so lowercase it.
    $host = strtolower($HTTP_HOST);
    
    // Use ereg() because ereg_replace will give a false positive
    // without another ereg() call (or a messy str*() call).
    eregi("([^.]+).boards.ie$", $host, $res);
    
    // Check we have a username.
    if (empty($res[1])) {
    
    	// If we don't, someone used an invalid domain name.
    	echo "Invalid domain name.";
    
    // We have a username, so...
    } else {
    
    	// Check to see if the user directory exists.
    	if (is_dir(/path/to/home/directories/$res[1]")) {
    
    		// Redirect to their URL
    		header("Location: [url="http://www.boards.ie/path/to/users/$res[1]/"]http://www.boards.ie/path/to/users/$res[1]/[/url]
    	} else {
    
    		// Not a valid user, output error message.
    		echo "Invalid user.";
    	
    	}
    
    }
    ?&gt;
    

    Finally, a note about wildcard DNS - it'll work for this application, but it can corrupt the zone file, particularly with reference to other RR types (A, CNAME, and particularly MX). Test it carefully before you set it live - your mileage may vary.

    adam

    [This message has been edited by dahamsta (edited 18-06-2001).]

    [This message has been edited by dahamsta (edited 18-06-2001).]


  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    Note the Location header is incorrect in that post, it's a long-standing bug/problem in UBB. See the PHP docs for the correct syntax.

    adam


  • Registered Users Posts: 521 ✭✭✭Ronin


    only thing is that they are not using apache but rather iis, and most likely don't have php installed..

    they are using iis4 on a winblows box.

    oh and their zone file isn't big enough to become currurpted(spelling) tis nice and small.

    Ro

    [This message has been edited by Ronin (edited 18-06-2001).]


  • Advertisement
  • Registered Users Posts: 1,202 ✭✭✭Renton


    im assuming ur using IIS, so do this smile.gif

    If you are using IIS, Go into the IIS "internet service manager"

    Then in the console root, you'll see a TREE, expand that, and you'll see the name of the PC.

    Add a new Web Site.

    put in whatever Discription you want

    It will then ask you to specify an Ip, you can drop down and select your IP (boards.ie?)

    Leave it to use port 80

    (click next)

    enter in the local path to where the webpage is stored. (x:\inetpub\wwwroot\blarg0r\)

    You can then select what access you want
    Read access, Script access, Execute access, Write access or Directory browsing
    (i suggesst the top two, Read access and script)

    then if you expand the list attached to the list of Webpages on the left, you'll see
    description (stopped)

    Right click and goto properties...

    In the "web page" tab, goto Advanced

    Double click on the only availiable thing to double click on
    (IP) (80) ( )
    Now thats blank cos u aint filled it in yet, double click on it and then in the host header name, fill in blarg.boards.ie

    and then close out of that and save your changes.

    You can then goto http://blarg.boards.ie and it will link the viewer to x:\inetpub\wwwroot\blarg0r\

    Hope it helps smile.gif

    RentZ


  • Registered Users Posts: 1,202 ✭✭✭Renton


    aw i just re-read devores original post and what i just said has nothing to do with it

    Soz guys smile.gif



  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    <font face="Verdana, Arial" size="2">only thing is that they are not using apache but rather iis, and most likely don't have php installed..</font>

    Surely IIS has a some form of VirtualHosting and default VirtualHosts?
    <font face="Verdana, Arial" size="2">they are using iis4 on a winblows box.</font>

    We all have our crosses to bear... smile.gif
    <font face="Verdana, Arial" size="2">oh and their zone file isn't big enough to become currurpted(spelling) tis nice and small.</font>

    Whose spelling? That came across wrong anyway, corrupted is probably a bad choice of word. What I meant was, if you have a wildcard record, the DNS server can get confused and use the wildcard instead of the correct record. AFAICR, there's a few questions about this on Mr. DNS.

    adam


  • Closed Accounts Posts: 296 ✭✭moist



    I suppose that will teach me to read books to the end in future :-)

    DNS & Bind 3rd Ed, Chapter 15.2 "Wildcards"

    That section also says "The danger with wildcards is that they clash with search lists."

    so apparently you _could_ get www.boards.ie.boards.ie though they only mention that with some versions
    of sendmail use search lists looking up MX records.


    So Dev, seems like its a worker smile.gif


  • Registered Users Posts: 521 ✭✭✭Ronin


    long as you put the wildcard in the correct place all is cool.Although I've yet to test it on any of my domains, although am guessing I will later.

    Plus I look after the the dns server boards is hosted on so its all good smile.gif..

    /me can't member how iis works haven't had to touch it in years smile.gif.

    Ro


  • Registered Users Posts: 521 ✭✭✭Ronin


    Dev,

    What you want to do is use a wildcard basically

    Take the boards.ie zone file and add a line like


    or
    * IN A 216.247.239.48

    Which will then allow ppl to ping anything.boards.ie

    then you just do some nice server side redirecting and that should do it for you.

    I'd tell you how to do it in apache but your using iis and I'm sure ye know how to do de redirecting..

    Oh and they won't have any problems getting IOL to do this. Cause if they want it done they just have to ask me smile.gif.

    Ro


Advertisement