Jump to content

Admin area | Allow access via DynDNS or similar


robotronik

Recommended Posts

Hi, I have built this great little script that I use quite often. Thought it was time to give something back to the community. Effectively what it does is only let the accounts with correct permissions through preventing attacks hugely, even if your system is infected and someone gets hold of your WHMCS password. Chances are they can't get authorised to get in.

 

How it works

It uses DynDNS, noip or a similar service to detect the current IP of the hostname which if setup properly will dynamically update. Meaning anyone who does not have the hostname record configured, will not be able to access it. It also restricts what computers can log into the system. A great little lockdown method :)

 

How to install

This applies to each user logging into admin area.

Upload the attached file (dnscron.php) to your WHMCS directory.

Follow the steps below to get a dynamic hostname working.

 

Setting up your hostname

1) Go to dyndns.com registration and setup an account.

2) Once registered go to 'My Services' tab, scroll to 'Host Services' and hit 'Add Hostname'.

3) Enter in the hostname box your desired name and a TLD to go alongside it.

4) At the 'IP Address' box, for now just hit 'Use auto detected IP address xx.xxx.xx.xxx.'

5) Scroll to the bottom of the page and click the 'Add to Cart' button. Note: This is a free service

6) The next page will load, your 'cart'. Click 'Next' then on the page after that click 'Activate Services'

7) You have now setup your hostname! But how to make it auto update?

Auto Updating your Hostname

Now, you have two options.

 

1) A lot of routers allow you to setup a DynDNS record in the admin panel usually something similar to 'DDNS', so if you can do that. Do it! All it requires is to enter your hostname, and your DynDNS.com login details.

 

dyndns.png

 

2) If you are do not have this option (Which I believe most people should) you can download DynDNS updater here - http://cdn.dyndns.com/windows/DynUpSetup.exe. I reccomend running this as a service. Again, this will require entering your username, selecting the hostname you want to update and of course password.

 

Now you should have dynamic DNS working!

 

All that is left to do is edit the dnscron.php $hostnames variable and setup a cron, we recommend running this cron every 20 minutes - 1 hour.

 

image2dt.png

 

*/20 * * * * php -q /home/youracc/public_html/WHMCSDIR/dnscron.php

 

Hope this is of some value for a lot of you.

dnscron.zip

Edited by robotronik
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated