Peanut shell Dynamic Domain name resolution through the Linux shell (DDNS)

Source: Internet
Author: User
Tags shell account


I have a Linux server at home and need to locate its IP address through the peanut Shell's DDNS. So create a script as follows to solve the problem of the recently appearing routing embedded device cannot DNS resolution, if you have the same needs as I do, welcome to this tutorial:



1, the installation of Yum package


Yum-y Install Curl


2. Create a folder to store scripts


mkdir ~/script


3. Create a domain name resolution script



Vim Editor ~/script/pusoray.sh



Add the following content:


#!/bin/bash
domain="example.oicp.net"
user="example"
pwd="pwd1"
/usr/bin/curl "http://$user:[email protected]/ph/update?hostname=$domain"


Note the parameters that need to be changed:



1) domain-name of your application for peanut shell



2) User-Login Peanut Shell account



3) PWD-Login peanut Shell password



4. Add a Scheduled task


Crontab-e


Add the following (performed every 5 minutes):


*/5 * * * * SH ~/script/pusoray.sh


Check:


Crontab-l


Reference documents:



Http://open.oray.com/wiki/doku.php?id=%E6%96%87%E6%A1%A3:%E8%8A%B1%E7%94%9F%E5%A3%B3:http%E5%8D%8F%E8%AE%AE%E8 %af%b4%e6%98%8e






This article is from the "Old Tan Linux Blog" blog, please be sure to keep this source http://cmdschool.blog.51cto.com/2420395/1703233



Peanut shell Dynamic Domain name resolution through the Linux shell (DDNS)


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.