Access site without DNS

Discussion in 'Tips/Tricks/Mods' started by Toucan, Jul 30, 2010.

  1. Toucan

    Toucan New Member

    I keep seeing posted time and time again people trying to access their site, without the domain having DNS entries.

    The answer is as usual edit the etc/hosts file on the client machine.

    ...but I was wondering, phpmyadmin and webmail can both be accessed with http://my.ip./webmail and I notice that webmail seems to use a symlink to another directory. So you can probably see the question coming, could a symlink or similar be used to to serve a site linking from the apache root directory to the new domain without the need to enter dns settings?

    To achieve something like this, http://my.ip/mynewsitewithnodns

    That way people could access unregistered sites before domain names bought, dns entered etc etc.

    Maybe my idea is crazy.. but if someone could answer before i get too curious, try it myself and break my set up!
     
  2. falko

    falko Super Moderator ISPConfig Developer

    Should be possible, but remember that you have to enable PHP and all the other stuff for the main vhost then. I think it's a good idea to take a look at the phpMyAdmin Apache configuration to see how they did it.
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    This depends very much on the website content. When the website contains only html files or a simple php based system that does not write to the local filesystem like phpmyadmin, then yes. If the site contains a cms like typo3, joomla or wordpress, then it will most likely fail or if you install it trough the symlink, it will not work correctly later when the site goes online. The reason is simple, with a symlink the php scripts run under the linux system user of the vhost that contains the symlink and not with the permissions of the target website. This is also a security problem as it allows your users to run php scripts with other permissions and so to circumvent the restrictions that jail their actions to their own website directory.
     
  4. Toucan

    Toucan New Member

    Thanks to you both. The simple concept does indeed have obvious flaws when though through.

    Maybe the answer will be to write a short script that can run client side that could write to the hosts file.

    Thanks guys.
     

Share This Page