Script Tips


Saturday, 07 October 2006 07:32

Security - DNS or DNSLess

Written by 
Rate this item
(0 votes)

Security - DNS or DNSLess

Choosing which method to use depends on your hosting company.

First lets look at the typical structure of a hosting account.
Most hosts will have a setup that looks like the following:

Account-Root\ 
                     logs \
                     mydomain.com\
                     ( where above mydomain.com is your public root - some hosts will name it differently)
                    database\
                    personal\

You are expected to place your database in the database directory and your Web files (index.html, main.html etc) in the mydomain.com directory.
IIS which comes with Windows 2003 has defaulted allow parent directories to off.
This is a security issue since this can allow script to access all directories if not set properly.
Some hosting companies will not change the default settings which limits a DNSLess connection to using the Web Root directory.
If this is the case for your hosting company then DNS is the best way to go else you must place the database within you Web root.
The safest place to place files for maximum security is in your account root!

DNS:
For a DNS connection you must setup an ODBC Data Source.
If your control panel allows this then you can set it up yourself else you must request it from your host support people.
Example:
strconn = "DSN=my-dataname"
Set dbc = Server.CreateObject("ADODB.Connection")
dbc.open strconn

DNSLess:
For a DNSLess connection you only need to set the connection string to the file location.
Example:
s_db_filename = "\database\my-database-filename"
s_db_path = Server.MapPath(s_db_filename)
strconn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & s_db_path
Set dbc = Server.CreateObject("ADODB.Connection")
dbc.open strconn

Vincent Gabriele

Read 5004 times Last modified on Wednesday, 22 April 2015 23:49

1 comment

  • Comment Link internet security 2015 Monday, 27 April 2015 21:51 posted by internet security 2015

    Greetings! This is my first visit to yur blog!
    We are a group of volunteers and starting a new project in a community iin the same niche.
    Your blog provded us useful information to work on. You have done a marvellous job!

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.

 

 

Script Tips Search

Registered User