Afraid.org and Dynamic IPs

SlartibartfastSlartibartfast Global Moderator-__-
edited July 2012 in Tech & Games
hey guys, check out Afraid.org if you need a dynamic IP domain. People share their domains and it's run by a freemium model.

It's essentially dynDNS with a lot of other stuff but for nerds. Not Necessarily only for dynamic IPs

you can manipulate CNAME, A, AAAA, MX, NS, TXT, LOC, RP, HINFO, SRV records

There is also support for IP6.

of course you will need a way to update the servers with your new IP. I personally use inadyn for this.
http://www.inatech.eu/inadyn/

It's a neat deamon written in C.

here's an example config script for inadyn:
--username pygar
--password yeahright
--update_period 60000
--forced_update_period 320000
--alias pygar.chickenkiller.com,VDhiR0_NOTMYREALSTRING_NOTMYREALSTRING_ODU=
--background
--dyndns_system [email protected]
--syslog
--log_file /path/to/inadyn.log

i save this as inadyn.conf

and run the daemon:
./inadyn --input_file /path/to/inadyn.conf

if you've installed inadyn from the repos you obviously don't need the './' bit as it will already be in $PATH

your authentication string is found under the 'Dynamic DNS' submenu, in the 'Direct URL' URL (copy everything after the '?')

with this pygar.chickenkiller.com resolves to my dynamic IP. You can register for other domains on their website (through the subdomains submenu).
check inadyn.log for success or failure.

putting it in crontab

to launch inadyn and boot put this in crontab (EDITOR=vim crontab -e)
@reboot /path/to/execuatable/inadyn --input_file /path/to/inadyn.conf 

to check if it's running every ten minutues, also put this in crontab (save it as inadyn.check).
#!/bin/bash
PROCESSCOUNT=$(ps -ef |grep -v grep |grep -cw inadyn)
echo $PROCESSCOUNT
if [ $PROCESSCOUNT -eq 2 ]
then
/path/to/exec/inadyn --input_file /path/to/inadyn.conf
else
echo "good";
fi
with
*/10 * * * * /path/to/inadyn.check

Comments

  • edited July 2012
    inadyn seems a lot easier than when I was using cron jobs to manage the script which told DynDNS what my new IP address was. Thanks for the suggestion, I want to give this a shot and get my server up and running again :D
  • SlartibartfastSlartibartfast Global Moderator -__-
    edited July 2012
    you still have to put it in cron trx100.

    i just run it on bootup. hasn't gone down since (12 days). It is C after all .

    I put this in crontab (EDITOR=vim crontab -e)

    @reboot /path/to/execuatable/inadyn --input_file /path/to/inadyn.conf
  • edited July 2012
    Oh, lol :facepalm: Makes sense, I dunno what I was thinking. I think I used to set my script to run hourly, back when we had problems with our internet disconnecting all the time.
  • SlartibartfastSlartibartfast Global Moderator -__-
    edited July 2012
    you've guilted me into doing it properly. This is my quick script (obv. it's not great).

    save this as inadyn.check (permisison +X and 777 (or whatever makes you comfortable)):
    #!/bin/bash
    PROCESSCOUNT=$(ps -ef |grep -v grep |grep -cw inadyn)
    echo $PROCESSCOUNT
    if [ $PROCESSCOUNT -eq 2 ]
    then
    /path/to/exec/inadyn --input_file /path/to/inadyn.conf
    else
    echo "good";
    fi
    

    and in crontab (EDITOR=vim crontab -e):
    */10 * * * * /path/to/inadyn.check
    

    this will check the daemon every 10 minutes; change it to whatevr you want.
  • SlartibartfastSlartibartfast Global Moderator -__-
    edited July 2012
    btw, i think i misunderstood you. inadyn is completely idependant of cron. It doesn't use it for its functions. I only use cron to check if it's running or not.
  • edited July 2012
    Right, that's what I was thinking to begin with. Am I right in thinking that the following line of code...
    --update_period 60000
    

    ... is the amount of time it waits before sending another update to inadyn? I also see that you've made the cron part of your post much clearer, thanks for clearing that up! Sorry for any confusion I caused ;)
  • DfgDfg Admin
    edited July 2012
    So, basically you're getting a sub-domain from them. But you can do much better with pygar.totseans.com :)
  • SlartibartfastSlartibartfast Global Moderator -__-
    edited July 2012
    INADYN Help

    INADYN is a dynamic DNS client. That is, it maintains the IP address
    of a host name. It periodically checks whether the IP address of the current machine
    (the external visible IP address of the machine that runs INADYN) has changed.
    If yes it performs an update in the dynamic dns server.

    Typical usage:
    -for dyndns.org system:
    inadyn -u username -p password -a my.registrated.name
    -for freedns.afraid.org:
    inadyn --dyndns_system [email protected] -a my.registrated.name,hash -a anothername,hash2
    'hash' is extracted from the grab url batch file that is downloaded from freedns.afraid.org

    Parameters:
    '--help': help
    '-h': help
    '--username': your membername/ hash
    '-u': your membername / hash
    '--password': your password. Optional.
    '-p': your password
    '--alias': alias host name. this option can appear multiple times.
    '-a': alias host name. this option can appear multiple times.
    '--input_file': the file containing [further] inadyn options.The default config file, '/etc/inadyn.conf' is used if inadyn is called without any cmd line options.
    '--ip_server_name': <srv_name[:port] local_url> - local IP is detected by parsing the response after returned by this server and URL.
    The first IP in found in http response is considered 'my IP'.
    Default value: 'checkip.dyndns.org /
    '--dyndns_server_name': [<NAME>[:port]]
    The server that receives the update DNS request.
    Allows the use of unknown DNS services that accept HTTP updates.
    If no proxy is wanted, then it is enough to set the dyndns system. The default servers will be taken.
    '--dyndns_server_url': <name>
    full URL relative to DynDNS server root.
    Ex: /some_script.php?hostname=

    '--dyndns_system': [NAME] - optional DYNDNS service type. SHOULD be one of the following:
    -For dyndns.org DNS system: [email protected] OR [email protected] OR [email protected].
    -For freedns.afraid.org DNS system: [email protected]
    -For www.zoneedit.com DNS system: [email protected]
    -For www.no-ip.com DNS system: [email protected]
    -For generic DNS system: [email protected]_svr_basic_auth
    DEFAULT value is intended for default service at dyndns.org (most users): [email protected]
    '--proxy_server': [NAME[:port]] - the http proxy server name and port. Default is none.
    '--update_period': how often the IP is checked. The period is in [ms]. Default is about 1 min. Max is 10 days
    '--update_period_sec': how often the IP is checked. The period is in [sec]. Default is about 1 min. Max is 10 days
    '--forced_update_period': how often the IP is updated even if it is not changed. [in sec]
    '--log_file': log file path abd name
    '--background': run in background. output to log file or to syslog
    '--verbose': set dbg level. 0 to 5
    '--iterations': set the number of DNS updates. Default is 0, which means infinity.
    '--syslog': force logging to syslog . (e.g. /var/log/messages). Works on **NIX systems only.
    '--change_persona': after init switch to a new user/group. Parameters: <uid[:gid]> to change to. Works on **NIX systems only.
    '--version': print the version number
    options.
Sign In or Register to comment.