Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section DNS Server
  • Search

Use Vesta CP as a Dynamic DNS Service

Questions regarding the DNS Server
BIND
Post Reply
  • Print view
Advanced search
6 posts • Page 1 of 1
rbrownell
Posts: 8
Joined: Tue Aug 16, 2016 1:03 pm

Use Vesta CP as a Dynamic DNS Service
  • Quote

Post by rbrownell » Fri Aug 26, 2016 12:26 pm

Hello All;

I am really enjoying Vesta CP and so I figured I would contribute these scripts and some instructions on how to remotely update VestaCP's DNS information with your dynamic WAN IP address. This allows for users to connect to their respective home/office networks without the need for a static WAN IP address by providing a domain name that they can use to connect with instead.

*** Integration with Vesta Control Panel *** - NEW!
The functionality of this script has been built out for inclusion as a service in Vesta Control Panel and is currently pending a Pull request on GitHub. With this functionality, updating your DNS Record associated with the DDNS service is as simple as requesting a URL with a few parameters for authentication purposes.

For a demonstration of this functionality, please check out the video found on the bottom of https://ryanbrownell.com/project/69

If you would help get this pushed into Vesta, please check out the pull request found at https://github.com/serghey-rodin/vesta/pull/1477, test the code and add comments indicating that you would use such a feature.

Warnings:
Should the DDNS service be added to the main Vesta Control Panel code base, this script will be abandoned.

This script was written with optional SSH authentication using a password. Use of this feature involves saving a password into your Linux machine's crontab in plain text format. The general convention states that this method is highly insecure. You should be using RSA keys for SSH authentication instead which is also supported by this script.

Requirements:
A Linux machine attached to the network with the dynamic WAN IP address. (I used a Raspberry Pi for this.)

Step 1:
Download scripts from https://github.com/ryanbrownell/DDNS-for-Vesta-CP/

Step 2:
Copy index.php into /home/{vesta username}/web/{domain name}/{public_html or public_shtml}/ip

Step 3:
Install sshpass on the Linux machine attached to the network with the dynamic WAN IP address.

Step 4:
Copy ddns-client.sh to the Linux machine attached to the network with the dynamic WAN IP address, into the user's ~/scripts directory.

Step 5:
Copy ddns-server.sh to the remote server running Vesta CP into the admin (or root) user's ~/scripts directory. Copy the contents of .bashrc into the admin user's .bashrc file.

Step 6:
Copy the following command into your crontab

Code: Select all

bash ~/scripts/ddns-client.sh {URL to index.php} {server domain name} {vesta username} {domain} {subdomain} {record type} {server admin username} {OPTIONAL server admin password}
and set it to run as frequently as you want, I would suggest hourly is best.

Notes:
For the URL to index.php, if you only use the directory instead of specifying the exact file, ensure to include a trailing slash (example.com/ip/) otherwise, CURL will only pull the header information for the redirect and not return a valid IP address.

This script is hosted on GitHub, so feel free to contribute.

TODO:
I plan to implement RSA SSH Authentication in the near future. (DONE)

Enjoy!
Last edited by rbrownell on Thu Feb 15, 2018 10:52 pm, edited 5 times in total.
Top

flaviustech
Posts: 1
Joined: Wed Oct 12, 2016 6:03 pm

Re: Use Vesta CP as a Dynamic DNS Service
  • Quote

Post by flaviustech » Wed Oct 12, 2016 7:20 pm

Can be more precise with step 4 and 5?
Top

rbrownell
Posts: 8
Joined: Tue Aug 16, 2016 1:03 pm

Re: Use Vesta CP as a Dynamic DNS Service
  • Quote

Post by rbrownell » Thu Feb 15, 2018 10:40 pm

flaviustech wrote:Can be more precise with step 4 and 5?
How so? The tilde (~) character represents the home directory which is usually found at /home/(USERNAME)

Hope this helps.
Last edited by rbrownell on Thu Oct 13, 2016 10:59 am, edited 1 time in total.
Top

rbrownell
Posts: 8
Joined: Tue Aug 16, 2016 1:03 pm

Re: Use Vesta CP as a Dynamic DNS Service
  • Quote

Post by rbrownell » Thu Feb 15, 2018 10:41 pm

This script is likely going to be abandoned with the approval of a pull request to add the same functionality directly to Vesta Control Panel itself. If you would help get this pushed into Vesta, please check out the pull request found at https://github.com/serghey-rodin/vesta/pull/1477 and test and add comments indicating that you would use such a feature.
Top

rj2010ism
Posts: 30
Joined: Thu Jan 03, 2019 11:04 am

Os: CentOS 5x
Web: apache + nginx
Re: Use Vesta CP as a Dynamic DNS Service
  • Quote

Post by rj2010ism » Tue May 07, 2019 12:27 pm

Good day.

I want to try this out? but i got a question?


Question? When setting this up with VestaCP.. how does this work?

1. Host(PC) login to VestaCP server give IP for remote client and use the VestaCP Upload speed to do connection in between?

or

2. Host(PC) login to VestaCP server give IP for remote client and use direct Dynamic IP that VestaCP got from host and give to client and not using VestaCP upload speed??

Thanks..
Top

pozzo-balbi
Posts: 6
Joined: Sat Jun 23, 2018 11:00 pm

Os: CentOS 6x
Web: nginx + php-fpm
Re: Use Vesta CP as a Dynamic DNS Service
  • Quote

Post by pozzo-balbi » Tue Jun 23, 2020 11:50 pm

You log into your control panel and if your package has ddns, then you can create a ddns record. The computer in the internet then loads an empty webpage and VestaCP updates the ddns record with the IP of the computer that loaded the website. Very nice!!
Top


Post Reply
  • Print view

6 posts • Page 1 of 1

Return to “DNS Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password