Git Product home page Git Product logo

dreamhost-dynamic-ip's Introduction

dreamhost-dynamic-ip

Shell script to run in a local server with dynamic ip, to update the dreamhost dns info when our ip has changed.

Three files here:

  • dns.ip.sh: The shell script which should be run in the local server. Give it execution permissions and include it in the crontab file: $ sudo crontab -e And add a line like: */30 * * * * /path/to/the/script/dns.ip.sh Note dreamhost has a limit in its api, so if you call the api more than a certain number of times, the next will be ignored until its counter resets.

  • whatismyip.php: a little php file which checks dyndns.com and gives you your ip. Put it somewhere reachable by your web server (maybe /var/www/something/whatismyip.php) and test it with a browser. It should show just an ip. Executing $ php whatismyip.php you should see the same result.

  • last_ip.txt: not really needed, here the last ip used is stored. For future use.

Installation/configuration:

Edit the first lines in dns.ip.sh with the paths used to store these files and include the Dreamhost API key. You can get one from https://panel.dreamhost.com/?tree=home.api and it must be of the type dns-* (All dns functions).

Edit the domain names you want to be updated. They must exist first in the dreamhost panel, of course. Go to https://panel.dreamhost.com/index.cgi?tree=domain.manage, select the domain managed by dreamhost which you want to use and click in its "DNS" link under the domain name. You could add new ones in the "Add a custom DNS record to" section (must be of Type A), or even use/update the main one, so it's not mandatory to have anything stored/hosted in dreamhost.

Hope it helps somebody. To test some kind of local server it was useful for me, and to test some services not allowed by the dreamhost hosting which you can use in your own local server.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.