OpenDNS with dynamic IP (inadyn)

Asked by Peter on 2007-09-12

My ISP provides a dynamic IP or different IP each time I log on.
I want to use OpenDNS to block porn, phishing etc but they require a static IP.
Their site says you can have a dynamic IP but not how to do it in Ubuntu 7.04
Does anyone know how to do this with dial up and Ubuntu 7.04 ?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Simos Xenitellis 
Solved:
2007-09-29
Last query:
2007-09-29
Last reply:
2007-09-29
Waleed Harbi (waleed-harbi) said : #1

Hello Peter,

You can do that via dyndns.com it is same idea OpenDNS, you need install their package on your system. please check to the following links:

www.dyndns.com
http://ubuntuguide.org/wiki/Ubuntu:Feisty/Networking#How_to_use_dynamic_IP_addressing_for_your_host_using_the_free_DynDNS_service
https://help.ubuntu.com/community/DynamicDNS
http://techteam.gr/linux/docs/ubuntu/ubuntu5.04/#assignhostnametodynamicip

Yours,
Waleed

Waleed Harbi (waleed-harbi) said : #2

Hello Peter,

You can do that via dyndns.com it is same idea OpenDNS, you need install their package on your system. please check to the following links:

www.dyndns.com
http://ubuntuguide.org/wiki/Ubuntu:Feisty/Networking#How_to_use_dynamic_IP_addressing_for_your_host_using_the_free_DynDNS_service
https://help.ubuntu.com/community/DynamicDNS
http://techteam.gr/linux/docs/ubuntu/ubuntu5.04/#assignhostnametodynamicip

Yours,
Waleed

Peter (nitep) said : #3

Hi Waleed,

Thanks for that. Do you mean use dyndns.com instead of OpenDNS.org?
Do they block porn, phishing etc?
Regards
Peter

Waleed Harbi (waleed-harbi) said : #4

Yes.

On 9/13/07, Peter <email address hidden> wrote:
>
> Question #13218 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/13218
>
> Status: Answered => Open
>
> Peter is still having a problem:
> Hi Waleed,
>
> Thanks for that. Do you mean use dyndns.com instead of OpenDNS.org?
> Do they block porn, phishing etc?
> Regards
> Peter
>
> --
> You received this question notification because you are a direct
> subscriber of the question.
>

--
====================================
Yours,
Waleed Harbi
Nothing without reason everything for some thing.

Peter (nitep) said : #5

Hi Waleed,

Sorry to be a nuisance but I have searched the http://www.dyndns.com site and there is no mention of block porn, phishing etc and that is the only reason I want to use it.

Regards
Peter

Simos Xenitellis  (simosx) said : #6

To get OpenDNS to work with dynamic IP, you need to get Ubuntu to set the OpenDNS DNS servers instead of the DNS servers that are provided from your ISP.

The instructions are at
http://www.opendns.com/start/ubuntu.php

The gist is to put a special command in /etc/dhcp3/dhclient.conf so that the OpenDNS DNS servers are preferred over the ones of your ISP.

Peter (nitep) said : #7

Hi Simos,
I had already set
208.67.222.222
208.67.220.220
as the DNS servers. That works well. The problem is to use the extra features of OpenDNS such as porn and phishing blocking you have to have a static IP as they use that IP as your account reference and they only store one IP but mine keeps changing. They have instructions on what to do in windows and mac to deal with dynamic IP's but when asked about Ubuntu they are most unhelpful.

Simos Xenitellis  (simosx) said : #8

Have you tried the instructions at
https://www.opendns.com/account/dynamic_dns/downloads/
You need the section "INADYN source code".

Apparently there is an ubuntu package for inadyn, however it would be good in this case to try the latest version from the above web page.

Peter (nitep) said : #9

I have looked at it but it does not make much sense to me. The instructions are for windows. I dont want to have to go back to windows but I want to keep my computer safe for when my grandchildren are here.

Simos Xenitellis  (simosx) said : #10

The URL has instructions for Ubuntu as well, though they may not be very straightforward.

In particular, from the URL
https://www.opendns.com/account/dynamic_dns/downloads/
and the section "INADYN source code" you click on "view instructions" and it shows

Unix
    * you will need gcc and libcurl with ssl support along with its development headers installed.
    * extract the zip file
    * if compiling on an architecture other than linux edit the makefile and set TARGET_ARCH to either linux, mac or solaris
    * run make
    * the executables are put under the bin/ folder
    * copy inadyn.conf to /etc
    * edit /etc/inadyn.conf with your OpenDNS username and password.

Though these instructions are terse, they apply to Ubuntu as well. Search in http://forums.opendns.com/
for additional help.

I can give the following as a guide. Hope it makes sense. You open a Terminal window and paste these in.
Please ask the people from OpenDNs to create an Ubuntu package that can do these automatically.

1. wget https://www.opendns.com/account/ddns_files/inadyn.source.v1.99.zip
2. unzip -a inadyn.source.v1.99.zip
3. cd inadyn.source.v1.99/
4. sudo apt-get install build-essential
5. sudo apt-get install libcurl3-openssl-dev
6. make
7. gedit inadyn.conf
here put your information (username, password, alias). Make sure on the OpenDNS settings you enable "Set Up a Dynamic IP".
8. sudo cp inadyn.conf /etc/
9. /bin/linux/inadyn

Once you run step 9, you will get the result

INADYN: Started 'INADYN version 1.99' - dynamic DNS updater.
I:INADYN: IP address for alias 'Office' needs update to '1.2.3.4'
I:INADYN: Alias 'Office' to IP '1.2.3.4' updated successful.

This means that you can run manually and correctly this process. Check in the OpenDNS forums and how to enable this automatically in your Ubuntu.

Peter (nitep) said : #11

Thanks Simos

Peter (nitep) said : #12

I have just discovered I am losing
208.67.222.222
208.67.220.220
on reboot
$ sudo gedit /etc/dhcp3/dhclient.conf
# append the following line to the document
prepend domain-name-servers 208.67.222.222,208.67.220.220;
# save and exit
doesnt work with dial up!!

Peter (nitep) said : #13

I have solved the problem of losing
208.67.222.222
208.67.220.220
on reboot. By a sheer fluke (I don't know what I am doing ) I discovered resolve .config in the etc folder and edited it to the DNS numbers 208.67.222.222 208.67.220.220 which are now retained on reboot.

I have not found "Check in the OpenDNS forums and how to enable this automatically in your Ubuntu." as mentioned by Simos so I still have the dynamic IP problem to solve.

Simos Xenitellis  (simosx) said : #14

Please check my reply on enabling "inadyn".

Peter (nitep) said : #15

I dont know what is going on. This morning the old DNS numbers are back even though they were retained yesterday on reboot?

Simos Xenitellis  (simosx) said : #16

I understand the part of not being able to keep settings in /etc/resolv.conf.
I am not quite sure either how to get the DNS servers fixed to the value we want.

A quick and dirty work-around is to set the values of /etc/resolv.conf to what we need, and then run

     sudo chattr +i /etc/resolv.conf

This command will make the file read-only. I mean really read-only, so nothing can touch/change the file.
To make it back normal (assuming you do not need OpenDNS anymore), run the same command with "-i" instead of "+i".

Regarding the part of using the individualised settings of OpenDNS with Ubuntu, you need to install and configure this "inadyn" package, that is also available in Ubuntu. I have some instructions above which might help.

Peter (nitep) said : #17

/etc/resolv.conf keep getting changed to
nameserver 210.55.12.1
nameserver 210.55.12.2
and so does /etc/ppp/resolv.conf
I did a complete system search for files containing 210.55.12.1 but did not find them. When I log on then network DNS has
208.67.222.222
208.67.220.220
but when I check back later they are reset to 210.55.12.1 210.55.12.2 That is what confused me when I said it was working.
I am still a little scared to try your INADYN: instructions but when I get this current problem sorted out I guess I will give it a go. Even more likely if you give me the undo instructions but it still has to be automatic. I have not found anything in the OpenDNS forums on how to enable this automatically.
Thanks for your help
Peter

Peter (nitep) said : #18

Hi Simos,
     sudo chattr +i /etc/resolv.conf has fixed the DNS from changing thanks.
Following your other instructions
1. wget https://www.opendns.com/account/ddns_files/inadyn.source.v1.99.zip
 gave file not found but I had previously downloaded it from somewhere cant remember now so I unzipped it but probably to the wrong place as /bin/linux/inadyn doesnt exist. Here is a copy of the terminal guff.

peter@peter-desktop:~$ wget https://www.opendns.com/account/ddns_files/inadyn.source.v1.99.zip
--10:13:33-- https://www.opendns.com/account/ddns_files/inadyn.source.v1.99.zip
           => `inadyn.source.v1.99.zip'
Resolving www.opendns.com... 208.67.219.101
Connecting to www.opendns.com|208.67.219.101|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
10:13:35 ERROR 404: Not Found.

peter@peter-desktop:~$ unzip -a inadyn.source.v1.99.zip
unzip: cannot find or open inadyn.source.v1.99.zip, inadyn.source.v1.99.zip.zip or inadyn.source.v1.99.zip.ZIP.
peter@peter-desktop:~$ unzip -a /home/peter/downloads/inadyn.source.v1.99.zip
Archive: /home/peter/downloads/inadyn.source.v1.99.zip
   creating: inadyn.source.v1.99/
   creating: inadyn.source.v1.99/src/
  inflating: inadyn.source.v1.99/src/psos_net.h [text]
  inflating: inadyn.source.v1.99/src/dyndns.c [text]
  inflating: inadyn.source.v1.99/src/curl_client.c [text]
  inflating: inadyn.source.v1.99/src/get_cmd.c [text]
  inflating: inadyn.source.v1.99/src/inadyn_cmd.c [text]
  inflating: inadyn.source.v1.99/src/dyndns.h [text]
  inflating: inadyn.source.v1.99/src/curl_client.h [text]
  inflating: inadyn.source.v1.99/src/get_cmd.h [text]
  inflating: inadyn.source.v1.99/src/debug_if.h [text]
  inflating: inadyn.source.v1.99/src/os.c [text]
  inflating: inadyn.source.v1.99/src/os_unix.c [text]
  inflating: inadyn.source.v1.99/src/main.c [text]
  inflating: inadyn.source.v1.99/src/errorcode.c [text]
  inflating: inadyn.source.v1.99/src/os_psos.c [text]
  inflating: inadyn.source.v1.99/src/os.h [text]
  inflating: inadyn.source.v1.99/src/errorcode.h [text]
  inflating: inadyn.source.v1.99/src/os_windows.c [text]
   creating: inadyn.source.v1.99/man/
  inflating: inadyn.source.v1.99/man/inadyn.8 [text]
  inflating: inadyn.source.v1.99/man/inadyn.conf.5 [text]
   creating: inadyn.source.v1.99/prj/
   creating: inadyn.source.v1.99/prj/ms_vcnet/
   creating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/
   creating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/
   creating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/include/
   creating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/include/curl/
   creating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/lib/
   creating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/curl-7.13.0/
   creating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/curl-7.13.0/include/
   creating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/curl-7.13.0/include/curl/
   creating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/curl-7.13.0/lib/
   creating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/curl-7.13.1/
   creating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/curl-7.13.1/include/
   creating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/curl-7.13.1/include/curl/
  inflating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/curl-7.13.1/include/curl/stdcheaders.h [text]
  inflating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/curl-7.13.1/include/curl/multi.h [text]
  inflating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/curl-7.13.1/include/curl/mprintf.h [text]
  inflating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/curl-7.13.1/include/curl/easy.h [text]
  inflating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/curl-7.13.1/include/curl/curlver.h [text]
 extracting: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/curl-7.13.1/include/curl/types.h [text]
  inflating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/curl-7.13.1/include/curl/curl.h [text]
   creating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/curl-7.13.1/lib/
  inflating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/curl-7.13.1/lib/libcurl.lib [binary]
  inflating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/ca-bundle.crt [text]
  inflating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/https.c [text]
  inflating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/https.ncb [binary]
  inflating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/https.vcproj [text]
  inflating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/libcurl.dll [binary]
  inflating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/https.dsp [text]
  inflating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/https.suo [binary]
  inflating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/ReadMe.txt [text]
  inflating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/https.sln [text]
  inflating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl-7.13.1-ssl-zlib-ares/https.dsw [text]
  inflating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/inadyn.vcproj [text]
  inflating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/inadyn.ncb [binary]
  inflating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/inadyn.conf [text]
  inflating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/libcurl.dll [binary]
  inflating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/inadyn.suo [binary]
  inflating: inadyn.source.v1.99/prj/ms_vcnet/inadyn/inadyn.sln [text]
  inflating: inadyn.source.v1.99/readme.html [text]
  inflating: inadyn.source.v1.99/inadyn.conf [text]
  inflating: inadyn.source.v1.99/makefile [text]
 extracting: inadyn.source.v1.99/remove_inadyn_service.bat [text]
  inflating: inadyn.source.v1.99/configure_inadyn_service_opendns.reg [text]
  inflating: inadyn.source.v1.99/install_inadyn_service.bat [text]
peter@peter-desktop:~$ cd inadyn.source.v1.99/
peter@peter-desktop:~/inadyn.source.v1.99$ sudo apt-get install build-essential
Password:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libio-zlib-perl libsmpeg0
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  dpkg-dev g++ g++-4.1 libc6-dev libstdc++6-4.1-dev linux-libc-dev
Suggested packages:
  debian-keyring gcc-4.1-doc lib64stdc++6 glibc-doc manpages-dev libstdc++6-4.1-doc
The following NEW packages will be installed:
  build-essential dpkg-dev g++ g++-4.1 libc6-dev libstdc++6-4.1-dev linux-libc-dev
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 8053kB of archives.
After unpacking 33.7MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://nz.archive.ubuntu.com feisty-security/main linux-libc-dev 2.6.20-16.29 [667kB]
Get:2 http://nz.archive.ubuntu.com feisty/main libc6-dev 2.5-0ubuntu14 [3018kB]
Get:3 http://nz.archive.ubuntu.com feisty/main libstdc++6-4.1-dev 4.1.2-0ubuntu4 [1632kB]
Get:4 http://nz.archive.ubuntu.com feisty/main g++-4.1 4.1.2-0ubuntu4 [2581kB]
Get:5 http://nz.archive.ubuntu.com feisty/main g++ 4:4.1.2-1ubuntu1 [1428B]
Get:6 http://nz.archive.ubuntu.com feisty/main dpkg-dev 1.13.24ubuntu6 [147kB]
Get:7 http://nz.archive.ubuntu.com feisty/main build-essential 11.3 [6974B]
Fetched 8053kB in 36m36s (3667B/s)
Selecting previously deselected package linux-libc-dev.
(Reading database ... 117798 files and directories currently installed.)
Unpacking linux-libc-dev (from .../linux-libc-dev_2.6.20-16.29_i386.deb) ...
Selecting previously deselected package libc6-dev.
Unpacking libc6-dev (from .../libc6-dev_2.5-0ubuntu14_i386.deb) ...
Selecting previously deselected package libstdc++6-4.1-dev.
Unpacking libstdc++6-4.1-dev (from .../libstdc++6-4.1-dev_4.1.2-0ubuntu4_i386.deb) ...
Selecting previously deselected package g++-4.1.
Unpacking g++-4.1 (from .../g++-4.1_4.1.2-0ubuntu4_i386.deb) ...
Selecting previously deselected package g++.
Unpacking g++ (from .../g++_4%3a4.1.2-1ubuntu1_i386.deb) ...
Selecting previously deselected package dpkg-dev.
Unpacking dpkg-dev (from .../dpkg-dev_1.13.24ubuntu6_all.deb) ...
Selecting previously deselected package build-essential.
Unpacking build-essential (from .../build-essential_11.3_i386.deb) ...
Setting up linux-libc-dev (2.6.20-16.29) ...
Setting up libc6-dev (2.5-0ubuntu14) ...
Setting up dpkg-dev (1.13.24ubuntu6) ...
Setting up libstdc++6-4.1-dev (4.1.2-0ubuntu4) ...
Setting up g++-4.1 (4.1.2-0ubuntu4) ...
Setting up g++ (4.1.2-1ubuntu1) ...

Setting up build-essential (11.3) ...
peter@peter-desktop:~/inadyn.source.v1.99$ sudo apt-get install libcurl3-openssl-dev
Password:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libio-zlib-perl libsmpeg0
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  comerr-dev libidn11-dev libkadm55 libkrb5-dev libssl-dev zlib1g-dev
Suggested packages:
  libcurl3-dbg krb5-doc
The following NEW packages will be installed:
  comerr-dev libcurl3-openssl-dev libidn11-dev libkadm55 libkrb5-dev libssl-dev zlib1g-dev
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 4676kB of archives.
After unpacking 12.5MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://nz.archive.ubuntu.com feisty/main zlib1g-dev 1:1.2.3-13ubuntu4 [407kB]
Get:2 http://nz.archive.ubuntu.com feisty/main libssl-dev 0.9.8c-4build1 [2068kB]
Get:3 http://nz.archive.ubuntu.com feisty/main libidn11-dev 0.6.5-1build1 [544kB]
Get:4 http://nz.archive.ubuntu.com feisty-security/main libkadm55 1.4.4-5ubuntu3.1 [177kB]
Get:5 http://nz.archive.ubuntu.com feisty/main comerr-dev 2.1-1.39+1.40-WIP-2006.11.14+dfsg-2ubuntu1 [46.4kB]
Get:6 http://nz.archive.ubuntu.com feisty-security/main libkrb5-dev 1.4.4-5ubuntu3.1 [672kB]
Get:7 http://nz.archive.ubuntu.com feisty-security/main libcurl3-openssl-dev 7.15.5-1ubuntu2.1 [762kB]
Fetched 4676kB in 18m23s (4236B/s)
Selecting previously deselected package zlib1g-dev.
(Reading database ... 119548 files and directories currently installed.)
Unpacking zlib1g-dev (from .../zlib1g-dev_1%3a1.2.3-13ubuntu4_i386.deb) ...
Selecting previously deselected package libssl-dev.
Unpacking libssl-dev (from .../libssl-dev_0.9.8c-4build1_i386.deb) ...
Selecting previously deselected package libidn11-dev.
Unpacking libidn11-dev (from .../libidn11-dev_0.6.5-1build1_i386.deb) ...
Selecting previously deselected package libkadm55.
Unpacking libkadm55 (from .../libkadm55_1.4.4-5ubuntu3.1_i386.deb) ...
Selecting previously deselected package comerr-dev.
Unpacking comerr-dev (from .../comerr-dev_2.1-1.39+1.40-WIP-2006.11.14+dfsg-2ubuntu1_i386.deb) ...
Selecting previously deselected package libkrb5-dev.
Unpacking libkrb5-dev (from .../libkrb5-dev_1.4.4-5ubuntu3.1_i386.deb) ...
Selecting previously deselected package libcurl3-openssl-dev.
Unpacking libcurl3-openssl-dev (from .../libcurl3-openssl-dev_7.15.5-1ubuntu2.1_i386.deb) ...
Setting up zlib1g-dev (1.2.3-13ubuntu4) ...
Setting up libssl-dev (0.9.8c-4build1) ...
Setting up libidn11-dev (0.6.5-1build1) ...

Setting up libkadm55 (1.4.4-5ubuntu3.1) ...

Setting up comerr-dev (2.1-1.39+1.40-WIP-2006.11.14+dfsg-2ubuntu1) ...

Setting up libkrb5-dev (1.4.4-5ubuntu3.1) ...
Setting up libcurl3-openssl-dev (7.15.5-1ubuntu2.1) ...

peter@peter-desktop:~/inadyn.source.v1.99$ make
mkdir -p "bin/linux"
gcc -Wall -pedantic -c -o "bin/curl_client.o" "src/curl_client.c"
gcc -Wall -pedantic -c -o "bin/dyndns.o" "src/dyndns.c"
src/dyndns.c: In function ‘dyn_dns_destruct’:
src/dyndns.c:609: warning: unused variable ‘rc’
gcc -Wall -pedantic -c -o "bin/errorcode.o" "src/errorcode.c"
gcc -Wall -pedantic -c -o "bin/get_cmd.o" "src/get_cmd.c"
gcc -Wall -pedantic -c -o "bin/main.o" "src/main.c"
gcc -Wall -pedantic -c -o "bin/os.o" "src/os.c"
gcc -Wall -pedantic -c -o "bin/os_psos.o" "src/os_psos.c"
gcc -Wall -pedantic -c -o "bin/os_unix.o" "src/os_unix.c"
gcc -Wall -pedantic -c -o "bin/os_windows.o" "src/os_windows.c"
gcc -Wall -pedantic -c -o "bin/inadyn_cmd.o" "src/inadyn_cmd.c"
gcc -o "bin/linux/inadyn" bin/curl_client.o bin/dyndns.o bin/errorcode.o bin/get_cmd.o bin/main.o bin/os.o bin/os_psos.o bin/os_unix.o bin/os_windows.o bin/inadyn_cmd.o -lcurl -ldl
peter@peter-desktop:~/inadyn.source.v1.99$

Do you have any ideas?

Simos Xenitellis  (simosx) said : #19

Wow, I am impressed. You managed to compile successfully "inadyn". The last part,

gcc -o "bin/linux/inadyn" bin/curl_client.o bin/dyndns.o bin/errorcode.o bin/get_cmd.o bin/main.o bin/os.o bin/os_psos.o bin/os_unix.o bin/os_windows.o bin/inadyn_cmd.o -lcurl -ldl
peter@peter-desktop:~/inadyn.source.v1.99$

shows that the "gcc" command for the final compilation "-o bin/linux/inadyn" did not produce any error message, which implies that it was successful (in Linux, when a command does not produce an error message, it means it went ok).

To sum up, the compiled "inadyn" file is located in the "bin/linux" subdirectory, and is called "inadyn".

At this stage you can continue with the next steps,

... (enter the directory where inadyn was extracted in)
7. gedit inadyn.conf
here put your information (username, password, alias). Make sure on the OpenDNS settings you enable "Set Up a Dynamic IP".
8. sudo cp inadyn.conf /etc/ (copy the configuration file to the default location)
9. bin/linux/inadyn (in order to execute/run the program)

Above I put "/bin/linux/inadyn" as the way to run the inadyn command. There is a typo there, you need "bin/linux/inadyn", or remove the initial slash.
You can also run the same program using "absolute paths" with "/home/peter/downloads/bin/linux/inadyn".

Peter (nitep) said : #20

Hi again Simos,
Hooray, it actually works. Thanks very much for your patience. Should I move
/home/peter/inadyn.source.v1.99/bin/linux/inadyn
to
/bin/linux/inadyn
All I need to find out now is how to get inadyn to run automatically at boot up.
I know how in windows but not Ubuntu

Regards
Peter

PS These forums are excellent when people like you are involved.

Simos Xenitellis  (simosx) said : #21

You can copy the "inadyn" program to "/usr/local/bin/".
The directory "/usr/local/bin" is considered the directory you put executable programs that you installed yourself.
This is good, because in this way you can keep an eye of what programs you add yourself. The packages from Add/Remove Programs install their files in /usr/bin/.

To copy "inadyn", you can type

sudo cp /home/peter/inadyn.source.v1.99/bin/linux/inadyn /usr/local/bin/

You can run "inadyn" using the command line

/usr/local/bin/inadyn

At this stage you manage to get "inadyn" working manually. With some effort from the OpenDNS team, it would be good to make a complete package so that a user can install and configure OpenDNS in an easier way.
It is possible for anyone who has the dedication, to create packages and get them accepted into Ubuntu, so that others can install easily. When you learn how to configure programs manually as you did, you can create packages some day for everyone to use.

Peter (nitep) said : #22

Hi again Simos,

I agree. Also in Ubuntu help there is a topic "Keeping your computer safe". It would be good to have details there on this method of blocking pornography from children etc.

/usr/local/bin/inadyn will start the program manually but how can I get it to start at bootup time automatically?

Regards
Peter

Simos Xenitellis  (simosx) said : #23

Hi,

I give below instructions on getting inadyn to start automatically. The best is to go to the maintainer of inadyn and get to make all these available by default. For this, see
https://bugs.launchpad.net/ubuntu/+source/inadyn/+bug/113260

So, here are the steps.

1. Run
sudo gedit /etc/init.d/inadyn
2. Copy and page in the text editor the following lines:
#!/bin/sh

DESC="Inadyn service"
NAME=inadyn

case "$1" in
    start)
        echo -n "Starting $DESC: $NAME"
        /usr/local/bin/inadyn
    ;;
    stop)
        echo "Terminating $DESC: $NAME"
        killall -TERM inadyn
    ;;
    reload|restart)
        $0 stop
        $0 start
    ;;
    *)
        echo "Usage: $0 start|stop|restart|reload"
        exit 1
    ;;
esac
exit 0

3. Run the command

sudo chmod +x /etc/init.d/inadyn

This will make the script "inadyn" executable.

4. Now we need to tell Ubuntu to start inadyn automatically when booting up.

sudo update-rc.d inadyn multiuser

If you want to remove "inadyn" from starting up automatically:

sudo update-rc.d -f inadyn remove

5. If you want to force inadyn to start or stop while using Ubuntu, try

sudo /etc/init.d/inadyn start

sudo /etc/init.d/inadyn stop

6. To see if inadyn is responding, click on System/Administration/System Log
Then, from all logs, click on /var/log/messages, and the last entries should mention how inadyn is doing.

Hope this helps.

littleubuntu (littleubuntu) said : #24

awesome.. nice work, been trying to do this for the past week..

Peter (nitep) said : #25

Hi again Simos,
If I run INADYN manually as shown below it works perfectly and when checking on OpenDNS I can see my IP updated

peter@peter-desktop:~$ /usr/local/bin/inadyn
INADYN: Started 'INADYN version 1.99' - dynamic DNS updater.
I:INADYN: IP address for alias 'network_label_to_update' needs update to '202.150.124.8'
I:INADYN: Alias 'network_label_to_update' to IP '202.150.124.8' updated successful.

However the autostartup is not working. I cannot see anything in the logfile but an error flashed by on the screen during startup too fast to see. Below is an alternative view using sudo /etc/init.d/inadyn start

peter@peter-desktop:~$ sudo /etc/init.d/inadyn start
Starting Inadyn service: inadynINADYN: Started 'INADYN version 1.99' - dynamic DNS updater.
couldn't resolve host nameW: DYNDNS: Error 'RC_HTTP_BAD_PARAMETER' (0x31) when talking to IP server
W:'RC_HTTP_BAD_PARAMETER' (0x31) updating the IPs. (it 0)
I:INADYN: IP address for alias 'network_label_to_update' needs update to '202.150.121.125'
W:INADYN: Error validating DYNDNS svr answer. Check usr,pass,hostname!

Regards
Peter

Simos Xenitellis  (simosx) said : #26

Hi Peter,

There reason it did not work was because when you booted the computer and inadyn started running, the network connection was not available, so it could not connect and decided to quit. That's the error message "couldn't resolve host nameW".
I did not try myself the autostart of inadyn in this way so I did not catch this issue. In addition, the way that NetworkManager works I do not thing my way of autostarting and the way that inadyn current works will fit together (NetworkManager enables the connection as soon as you log in to Ubuntu, and "inadyn" demands an Internet connection as soon as starts running -- before you login). Inadyn should be fixed here so that when there is no Net connection, it should wait and check again in a few secods.

Due to the issue of inadyn and NetworkManager, the alternative would be for inadyn start as soon as the network connection is available. This would mean to add "inadyn" somewhere in the configuration scripts in /etc/network/. I will be able to look into this next week.

I forgot to mention that for the automatic script to work (that is, when the Net connection is actually available), you need to add the parameter

--background

in /etc/inadyn.conf.

That is,
sudo gedit /etc/inadyn.conf

This parameter will get inadyn to become a service and work in the background. In this case, you can see any error messages in System/Administration/System Log, under "/var/log/messages".

tmosprmo (tmosprmo) said : #27

you can use apt-get install to get inadyn (I just did that myself). I also have opendns, which is ready to accept dynamic dns (although i have not yet configured inadyn to work on my linux server and in fact i don't know how)

Waleed mentioned dyndns because it performs a similar function to inadyn--but in this case I do not believe that dyndns will work with opendns. Opendns provides such a professional service--i wish they would also provide an easy program for continually updating dynamic addresses from all 3 platforms.

Peter (nitep) said : #28

Hi Simos,
Here is the error message from the log file at auto boot up and the attempted start of Inadyn
________________________________________________________________________________
Sep 21 12:57:14 peter-desktop INADYN[4870]: INADYN: Started 'INADYN version 1.99' - dynamic DNS updater.
Sep 21 12:57:14 peter-desktop INADYN[4870]: W: DYNDNS: Error 'RC_HTTP_BAD_PARAMETER' (0x31) when talking to IP server
Sep 21 12:57:14 peter-desktop INADYN[4870]: W:'RC_HTTP_BAD_PARAMETER' (0x31) updating the IPs. (it 0)
________________________________________________________________________________
The system monitor shows that it is not running. If I start Inadyn manually with /usr/local/bin/inadyn here is what happens when the modem is turned off.
________________________________________________________________________________
Sep 21 13:47:15 peter-desktop INADYN[6950]: INADYN: Started 'INADYN version 1.99' - dynamic DNS updater.
Sep 21 13:47:15 peter-desktop INADYN[6950]: W: DYNDNS: Error 'RC_HTTP_BAD_PARAMETER' (0x31) when talking to IP server
Sep 21 13:47:15 peter-desktop INADYN[6950]: W:'RC_HTTP_BAD_PARAMETER' (0x31) updating the IPs. (it 0)
________________________________________________________________________________
It does not terminate and system monitor shows it to be running. It then has another go
________________________________________________________________________________
Sep 21 13:49:20 peter-desktop INADYN[6950]: W: DYNDNS: Error 'RC_HTTP_BAD_PARAMETER' (0x31) when talking to IP server
Sep 21 13:49:20 peter-desktop INADYN[6950]: W:'RC_HTTP_BAD_PARAMETER' (0x31) updating the IPs. (it 1)
________________________________________________________________________________
After a few more tries I turned on the external 56k dial up modem and it succeeded
________________________________________________________________________________
Sep 21 13:52:13 peter-desktop pppd[3948]: secondary DNS address 210.55.12.2
Sep 21 13:53:24 peter-desktop INADYN[6950]: I:INADYN: IP address for alias 'network_label_to_update' needs update to '202.150.125.173'
________________________________________________________________________________
It does not show success but a check at OpenDNS showed that 202.150.125.173 had been stored there. It only terminates at the auto boot up.
___________________________________________________________________________
Hope this is of some help,
Regards,
Peter

Simos Xenitellis  (simosx) said : #29

Can you paste here the contents of /etc/inadyn.conf please?

Make sure you hide the username/password values.

Peter (nitep) said : #30

Dear Simos

--username ******
--password ********
--alias network_label_to_update
--secure
--dyndns_server_name updates.opendns.com
--dyndns_server_url /account/ddns.php?
--background

I did not know what to do about the alias but it works okay when started manually.
Did you notice the same error message above when started at boot time and terminated as when started manually but does not terminate?

Regards
Peter

Peter (nitep) said : #31

Dear Simos
More info that may help. If the modem connects in time then the auto bootup of Inadyn updates the IP at OpenDNS before it shuts down. I still want it to not shut down though. Although the GUI DNS setting shows DNS 208.67.222.222 and
208.67.220.220 the sytem log syslog shows
Sep 24 18:24:50 peter-desktop pppd[3948]: local IP address 202.150.122.81
Sep 24 18:24:50 peter-desktop pppd[3948]: remote IP address 222.152.43.193
Sep 24 18:24:50 peter-desktop pppd[3948]: primary DNS address 210.55.12.1
Sep 24 18:24:50 peter-desktop pppd[3948]: secondary DNS address 210.55.12.2
so the old addresses of 210.55.12.1 and .2 are showing up. Which do I believe, the GUI or the syslog.
To prevent this I edited to 208.67.222.222 etc. and made read-only the following
files
 /etc/resolv.conf.auto
 /etc/resolv.conf.pppd-backup
 /etc/resolv.conf.tmp
 /etc/ppp/resolv.conf
but after that I could not connect at all even after putting them back as not read-only and editing them back to what they were. I thought I would have to reinstall the system until on reboot after quite a few attempts the computer got an internet connection in time to recover.
Inadyn also only works if the computer gets an internet connection in time which is rare.
Regards
Peter

Peter (nitep) said : #32

Sep 24 18:24:50 peter-desktop pppd[3948]: primary DNS address 210.55.12.1
Sep 24 18:24:50 peter-desktop pppd[3948]: secondary DNS address 210.55.12.2
so the old addresses of 210.55.12.1 and .2 are showing up. Which do I believe, the GUI or the syslog.
To answer my own question. Although the log files show DNS address 210.55.12.1 the system must be using the GUI values as stored in /etc/resolv.conf because OpenDNS is storing statistics and blocking sites as it should be. I just need to be able to keep Inadyn running from bootup

Peter (nitep) said : #33

Dear Simos
I hope you are not tired of these extra notes, but now more often than not Inadyn is doing its job on auto start at bootup. As shown here from the user log.

Sep 26 15:33:10 peter-desktop hpiod: 1.7.3 accepting connections at 2208...
Sep 26 15:33:16 peter-desktop INADYN[4860]: INADYN: Started 'INADYN version 1.99' - dynamic DNS updater.
Sep 26 15:33:16 peter-desktop INADYN[4860]: W: DYNDNS: Error 'RC_HTTP_BAD_PARAMETER' (0x31) when talking to IP server
Sep 26 15:33:16 peter-desktop INADYN[4860]: W:'RC_HTTP_BAD_PARAMETER' (0x31) updating the IPs. (it 0)
Sep 26 15:33:29 peter-desktop gconfd (joy-5346): starting (version 2.18.0.1), pid 5346 user 'joy'

I deleted a bit here. Failed at first but 2 mins later succeeded.

Sep 26 15:35:20 peter-desktop INADYN[4860]: I:INADYN: IP address for alias 'network_label_to_update' needs update to '202.150.119.206'
Sep 26 15:41:13 peter-desktop gconfd (joy-5346): Exiting
Sep 26 15:41:28 peter-desktop gconfd (peter-5731): starting (version 2.18.0.1), pid 5731 user 'peter'

It still fails at times. Even when it works it never shows up in the system monitor as it does on manual start.
Regards
Peter

Simos Xenitellis  (simosx) said : #34

Hi Peter,
The messages such as
Sep 24 18:24:50 peter-desktop pppd[3948]: primary DNS address 210.55.12.1
Sep 24 18:24:50 peter-desktop pppd[3948]: secondary DNS address 210.55.12.2
report the DNS addresses that the PPP service managed to receive.
It is on the discretion of the PPP client software where to use those values, or use other values as specified in /etc/dhcp3/dhclient.conf

I tried twice to get inadyn started automatically and it worked both times for me.
I think the goal is to get inadyn working at least manually from the command line, which it has been achieved.
To get inadyn properly integrated as a service in Ubuntu, it's is important to make efforts outside Ubuntu Answers.
That is,
1. contact people from the OpenDNS developers at the OpenDNS forum to help maintain/package inadyn for easier use by end-users.
2. File a bug report at the Ubuntu inadyn package to update the software to the most recent version of the package, and make sure it works out of the box for the end-users.

To find bug reports/enhancements for the Ubuntu inadyn package, see
https://launchpad.net/ubuntu/+source/inadyn/+bugs

You will notice that there is an item already to update inadyn to the latest version you get from its website. You can subscribe there, and also post a message of support.

I think it would be good to close this report and move this discussion at
https://launchpad.net/ubuntu/+source/inadyn/+bugs
What do you think?

Peter (nitep) said : #35

Hi Simos,
Thanks for all your help. I think you are correct, but first I have tried to summarise all this to give to OpenDNS to put in their DDNS downloads page for Ubuntu users. Can you see any errors? You will see that the wget line you gave me had an error that I have corrected.
___________________________________________________________________________
The following information was kindly supplied by Simos Xenitellis
You can use OpenDNS to block porn, phishing etc. to keep your computer safe for your children, grandchildren etc.

To get OpenDNS to work with Ubuntu set the OpenDNS DNS servers instead of the DNS servers that are provided from your ISP.
These are
208.67.222.222
208.67.220.220

The instructions are at
http://www.opendns.com/start/ubuntu.php
___________________________________________________________________________
If you keep losing these new DNS settings then a quick and dirty work-around is to set the values of /etc/resolv.conf to what we need, and then run

     sudo chattr +i /etc/resolv.conf

This command will make the file read-only. I mean really read-only, so nothing can touch/change the file.
To change it back to normal (assuming you do not need OpenDNS anymore), run the same command with "-i" instead of "+i".
___________________________________________________________________________

If your ISP gives a dynamic IP then you need a program to update your IP at OpenDNS.
A good one is Inadyn
The following will download the source code and compile it on your computer.
Do the following in a terminal.

1. wget https://www.opendns.com/support/ddns_files/inadyn.source.v1.99.zip
2. unzip -a inadyn.source.v1.99.zip
3. cd inadyn.source.v1.99/
4. sudo apt-get install build-essential
5. sudo apt-get install libcurl3-openssl-dev
6. make
7. gedit inadyn.conf
here put your information (username, password). Also add the line
--background
 Make sure on the OpenDNS settings you enable "Set Up a Dynamic IP".
8. sudo cp inadyn.conf /etc/
9. bin/linux/inadyn

Once you run step 9, you will get the result

INADYN: Started 'INADYN version 1.99' - dynamic DNS updater.
I:INADYN: IP address for alias 'Office' needs update to '1.2.3.4'
I:INADYN: Alias 'Office' to IP '1.2.3.4' updated successful.

This means that you can run manually and correctly this process.
___________________________________________________________________________

To have Inadyn start automatically at boot up time.

1. Run
sudo gedit /etc/init.d/inadyn
2. Copy and paste into the text editor the following lines:

#!/bin/sh

DESC="Inadyn service"
NAME=inadyn

case "$1" in
    start)
        echo -n "Starting $DESC: $NAME"
        /usr/local/bin/inadyn
    ;;
    stop)
        echo "Terminating $DESC: $NAME"
        killall -TERM inadyn
    ;;
    reload|restart)
        $0 stop
        $0 start
    ;;
    *)
        echo "Usage: $0 start|stop|restart|reload"
        exit 1
    ;;
esac
exit 0

3. Run the command

sudo chmod +x /etc/init.d/inadyn

This will make the script "inadyn" executable.

4. Now we need to tell Ubuntu to start inadyn automatically when booting up.

sudo update-rc.d inadyn multiuser

If you want to remove "inadyn" from starting up automatically at a later date:

sudo update-rc.d -f inadyn remove

5. If you want to force inadyn to start or stop while using Ubuntu, try

sudo /etc/init.d/inadyn start

sudo /etc/init.d/inadyn stop

6. To see if inadyn is responding, click on System/Administration/System Log
Then, from all logs, click on /var/log/user.log, and the last entries should mention how inadyn is doing.

___________________________________________________________________________

Simos Xenitellis  (simosx) said : #36

Hi Peter,
That's a good summary.

Now it's my third time booting Ubuntu with the inadyn script and it works without a glitch.

There is an issue with the /etc/init.d/inadyn script; as it is now, it cannot terminate ("stop" parameter) in an elegant way. What we need to do is rename it to /etc/init.d/inadynsvc (as in Inadyn SerViCe).
The reason of the problem is the command "killall -TERM inadyn". This terminates /usr/local/bin/inadyn (that's good) but also terminates the script /etc/init.d/inadyn itself, which is not smart. So we rename the script to "inadynsvc" and it should be ok.
I attach below the corrected segment of the summary. You can copy-paste the section.

==========================
1. Run
sudo gedit /etc/init.d/inadynsvc
2. Copy and paste into the text editor the following lines:

#!/bin/sh

DESC="Inadyn service"
NAME=inadyn

case "$1" in
    start)
        echo -n "Starting $DESC: $NAME"
        /usr/local/bin/inadyn
    ;;
    stop)
        echo "Terminating $DESC: $NAME"
        killall -TERM inadyn
    ;;
    reload|restart)
        $0 stop
        $0 start
    ;;
    *)
        echo "Usage: $0 start|stop|restart|reload"
        exit 1
    ;;
esac
exit 0

3. Run the command

sudo chmod +x /etc/init.d/inadynsvc

This will make the script "inadynsvc" executable.

4. Now we need to tell Ubuntu to start "inadynsvc" automatically when booting up.

sudo update-rc.d inadynsvc multiuser

If you want to remove "inadynsvc" from starting up automatically at a later date:

sudo update-rc.d -f inadynsvc remove

5. If you want to force "inadynsvc" to start or stop while using Ubuntu, try

sudo /etc/init.d/inadynsvc start

sudo /etc/init.d/inadynsvc stop

6. To see if inadyn is responding, click on System/Administration/System Log
Then, from all logs, click on /var/log/user.log, and the last entries should mention how inadyn is doing.
====================================

Peter (nitep) said : #37

Hi Simos,
Thanks for that. I have discovered where it is failing as follows. We use dial up and when we want to free the phone line we disconnect. In 6.10 we could click on the phone icon and deactivate. This is not available in 7.04 so we simply switch off the external modem. When we want to connect we switch the modem on again. I can see in the log file that the system tries to connect periodically when the modem is switched off. If the modem is switched off at bootup then Inadyn fails. If the modem is on it succeeds. If we turn the modem off and later on again it gets a connection with a different IP but Inadyn does not restart. Perhaps the script that causes the system to try and reconnect could start Iadyn after a connection?
Regards
Peter

Simos Xenitellis  (simosx) said : #38

Hi Peter,
Indeed, it looks to me that inadyn should not start as a standalone service. It should be attached with the establishing of a new internet connection. Once you get connected to the Net, inadyn should start automatically.

From the instructions above, we need to make the following changes:

1. We remove the inadyn service from /etc/init.d/
by running the command

sudo update-rc.d -f inadynsvc remove
2. The place to put our script to run is at

/etc/network/if-up.d/

In there you can put scripts and commands to run once an internet connection is established.

Here we put a file called "inadynsvc" with the content

================
#!/bin/sh

if [ ! -x /usr/local/bin/inadyn ]; then
        exit 0
fi

if [ ! -r /etc/inadyn.conf ]; then
        exit 0
fi

if [ "$METHOD" = loopback ]; then
        exit 0
fi

# Terminate any existing inadyn services running.
/usr/bin/killall -TERM inadyn

/usr/local/bin/inadyn

exit 0
=============

Then, we also add a similar (but different file) for

/etc/network/if-post-down.d/ called inadynsvc, with contents

===================
#!/bin/sh

if [ ! -x /usr/local/bin/inadyn ]; then
        exit 0
fi

if [ ! -r /etc/inadyn.conf ]; then
        exit 0
fi

if [ "$METHOD" = loopback ]; then
        exit 0
fi

# Terminate any existing inadyn services running.
/usr/bin/killall -TERM inadyn

exit 0
================

The second file is just to make sure that inadyn stops once we shutdown the Net connection.

We need to make these files executable, so

sudo chmod 755 /etc/network/if-post-down.d/inadynsvc
sudo chmod 755 /etc/network/if-up.d/inadynsvc

I think that's it. When you restart your Net connection (dialup, wireless, ethernet, etc), inadyn starts up.
Give it a go and please send some feedback.

Peter (nitep) said : #39

Hi Simos,

I like that idea. It worked at bootup but not after the modem had been switched off them on again. Here is what I did .

peter@peter-desktop:~$ sudo update-rc.d -f inadyn remove
 Removing any system startup links for /etc/init.d/inadyn ...
   /etc/rc1.d/K20inadyn
   /etc/rc2.d/S20inadyn
   /etc/rc3.d/S20inadyn
   /etc/rc4.d/S20inadyn
   /etc/rc5.d/S20inadyn
peter@peter-desktop:~$ sudo gedit /etc/network/if-up.d/inadynsvc

(This file contains the following. Of course this line is not in the file.)

#!/bin/sh

if [ ! -x /usr/local/bin/inadyn ]; then
        exit 0
fi

if [ ! -r /etc/inadyn.conf ]; then
        exit 0
fi

if [ "$METHOD" = loopback ]; then
        exit 0
fi

# Terminate any existing inadyn services running.
/usr/bin/killall -TERM inadyn

/usr/local/bin/inadyn

exit 0

peter@peter-desktop:~$ sudo gedit /etc/network/if-post-down.d/inadynsvc

(This file contains the following. Of course this line is not in the file.)

#!/bin/sh

if [ ! -x /usr/local/bin/inadyn ]; then
        exit 0
fi

if [ ! -r /etc/inadyn.conf ]; then
        exit 0
fi

if [ "$METHOD" = loopback ]; then
        exit 0
fi

# Terminate any existing inadyn services running.
/usr/bin/killall -TERM inadyn

exit 0

peter@peter-desktop:~$ sudo chmod 755 /etc/network/if-post-down.d/inadynsvc
peter@peter-desktop:~$ sudo chmod 755 /etc/network/if-up.d/inadynsvc

peter@peter-desktop:~$

==========================================
and here is part of the sys log that I think is relevant
=======================================
Sep 28 11:51:23 peter-desktop syslogd 1.4.1#20ubuntu4: restart.

Sep 28 11:51:43 peter-desktop chat[4121]: CONNECT
Sep 28 11:51:43 peter-desktop chat[4121]: -- got it
Sep 28 11:51:43 peter-desktop pppd[3948]: Serial connection established.
Sep 28 11:51:43 peter-desktop pppd[3948]: Using interface ppp0

Sep 28 11:51:46 peter-desktop pppd[3948]: Cannot determine ethernet address for proxy ARP
Sep 28 11:51:46 peter-desktop pppd[3948]: local IP address 202.150.117.152
Sep 28 11:51:46 peter-desktop pppd[3948]: remote IP address 222.152.43.193
Sep 28 11:51:46 peter-desktop pppd[3948]: primary DNS address 210.55.12.1
Sep 28 11:51:46 peter-desktop pppd[3948]: secondary DNS address 210.55.12.2

Sep 28 11:53:30 peter-desktop INADYN[3958]: I:INADYN: IP address for alias 'network_label_to_update' needs update to '202.150.117.152'

==================================================
Here it worked. Later I switched off the modem.
=================================================

Sep 28 11:59:39 peter-desktop pppd[3948]: Hangup (SIGHUP)
Sep 28 11:59:39 peter-desktop pppd[3948]: Modem hangup
Sep 28 11:59:39 peter-desktop pppd[3948]: Connect time 7.9 minutes.
Sep 28 11:59:39 peter-desktop pppd[3948]: Sent 288068 bytes, received 1080193 bytes.
Sep 28 11:59:39 peter-desktop pppd[3948]: Connection terminated.
Sep 28 12:00:10 peter-desktop chat[5741]: timeout set to 60 seconds
Sep 28 12:00:10 peter-desktop chat[5741]: abort on (ERROR)
Sep 28 12:00:10 peter-desktop chat[5741]: abort on (BUSY)
Sep 28 12:00:10 peter-desktop chat[5741]: abort on (VOICE)
Sep 28 12:00:10 peter-desktop chat[5741]: abort on (NO CARRIER)
Sep 28 12:00:10 peter-desktop chat[5741]: abort on (NO DIALTONE)
Sep 28 12:00:10 peter-desktop chat[5741]: abort on (NO DIAL TONE)
Sep 28 12:00:10 peter-desktop chat[5741]: abort on (NO ANSWER)
Sep 28 12:00:10 peter-desktop chat[5741]: send (ATZ^M)
Sep 28 12:00:10 peter-desktop chat[5741]: send (AT&FH0L1^M)
Sep 28 12:00:10 peter-desktop chat[5741]: expect (OK)
Sep 28 12:00:10 peter-desktop chat[5741]: ATZ^M^M
Sep 28 12:00:10 peter-desktop chat[5741]: OK
Sep 28 12:00:10 peter-desktop chat[5741]: -- got it
Sep 28 12:00:10 peter-desktop chat[5741]: send (ATDT087305656^M)
Sep 28 12:00:11 peter-desktop chat[5741]: timeout set to 75 seconds
Sep 28 12:00:11 peter-desktop chat[5741]: expect (CONNECT)
Sep 28 12:00:11 peter-desktop chat[5741]: ^M
Sep 28 12:01:10 peter-desktop chat[5741]: L1^MATDT087305656^M^M
Sep 28 12:01:10 peter-desktop chat[5741]: NO CARRIER
Sep 28 12:01:10 peter-desktop chat[5741]: -- failed
Sep 28 12:01:10 peter-desktop chat[5741]: Failed (NO CARRIER)
Sep 28 12:01:10 peter-desktop pppd[3948]: Connect script failed
Sep 28 12:01:42 peter-desktop chat[5779]: timeout set to 60 seconds
Sep 28 12:01:42 peter-desktop chat[5779]: abort on (ERROR)
Sep 28 12:01:42 peter-desktop chat[5779]: abort on (BUSY)
Sep 28 12:01:42 peter-desktop chat[5779]: abort on (VOICE)
Sep 28 12:01:42 peter-desktop chat[5779]: abort on (NO CARRIER)
Sep 28 12:01:42 peter-desktop chat[5779]: abort on (NO DIALTONE)
Sep 28 12:01:42 peter-desktop chat[5779]: abort on (NO DIAL TONE)
Sep 28 12:01:42 peter-desktop chat[5779]: abort on (NO ANSWER)
Sep 28 12:01:42 peter-desktop chat[5779]: send (ATZ^M)
Sep 28 12:01:42 peter-desktop chat[5779]: send (AT&FH0L1^M)
Sep 28 12:01:43 peter-desktop chat[5779]: expect (OK)
Sep 28 12:01:43 peter-desktop chat[5779]: ATZ^M^M
Sep 28 12:01:43 peter-desktop chat[5779]: OK
Sep 28 12:01:43 peter-desktop chat[5779]: -- got it
Sep 28 12:01:43 peter-desktop chat[5779]: send (ATDT087305656^M)
Sep 28 12:01:43 peter-desktop chat[5779]: timeout set to 75 seconds
Sep 28 12:01:43 peter-desktop chat[5779]: expect (CONNECT)
Sep 28 12:01:43 peter-desktop chat[5779]: ^M
Sep 28 12:02:04 peter-desktop chat[5779]: L1^MATDT087305656^M^M
Sep 28 12:02:04 peter-desktop chat[5779]: CONNECT
Sep 28 12:02:04 peter-desktop chat[5779]: -- got it
Sep 28 12:02:04 peter-desktop pppd[3948]: Serial connection established.
Sep 28 12:02:04 peter-desktop pppd[3948]: Using interface ppp0
Sep 28 12:02:04 peter-desktop pppd[3948]: Connect: ppp0 <--> /dev/ttyS1
Sep 28 12:02:05 peter-desktop pppd[3948]: PAP authentication succeeded
Sep 28 12:02:06 peter-desktop pppd[3948]: Cannot determine ethernet address for proxy ARP
Sep 28 12:02:06 peter-desktop pppd[3948]: local IP address 60.234.125.67
Sep 28 12:02:06 peter-desktop pppd[3948]: remote IP address 222.152.43.193
Sep 28 12:02:06 peter-desktop pppd[3948]: primary DNS address 210.55.12.1
Sep 28 12:02:06 peter-desktop pppd[3948]: secondary DNS address 210.55.12.2
Sep 28 12:03:43 peter-desktop kernel: [ 813.839746] Inbound IN=ppp0 OUT= MAC= SRC=221.209.110.8 DST=60.234.125.67 LEN=485 TOS=0x00 PREC=0x00 TTL=48 ID=0 DF PROTO=UDP SPT=50559 DPT=1026 LEN=465
===================================================================
Inadyn did not run to update IP. Also an earlier warning about wireless network
but that did not stop Inadyn running correctly at bootup
========================================
Sep 28 11:52:05 peter-desktop NetworkManager: <WARNING>^I nm_dbus_get_networks_cb (): error received: org.freedesktop.NetworkManagerInfo.NoNetworks - There are no wireless networks stored..
========================================
What have I done incorrectly?
Regards
Peter

Peter (nitep) said : #40

Dear Simos
This might help. After bootup Inadyn started. From user log
================================
Sep 28 13:01:56 peter-desktop INADYN[3943]: I:INADYN: IP address for alias 'network_label_to_update' needs update to '202.150.115.189'
===============================
And it worked. I turned off the modem then on again but Inadyn did not start, so I did the following manually.
===============================
peter@peter-desktop:~$ sudo /etc/network/if-post-down.d/inadynsvc
Password:
==============================
Nothing appeared in any log.
===========================
peter@peter-desktop:~$ sudo /etc/network/if-up.d/inadynsvc
inadyn: no process killed
peter@peter-desktop:~$
================================
The following appeared in the logs
================================
Sep 28 13:08:42 peter-desktop INADYN[5927]: INADYN: Started 'INADYN version 1.99' - dynamic DNS updater.
Sep 28 13:08:43 peter-desktop INADYN[5927]: I:INADYN: IP address for alias 'network_label_to_update' needs update to '202.150.112.218'
=================================
And it worked. So it is not restarting automatically on reconnect.
Regards
Peter

Simos Xenitellis  (simosx) said : #41

I am not quite familiar how you use the modem in Ubuntu with NetworkManager.
What exactly do you run to get the modem connect or disconnect?

The command sudo /etc/network/if-up.d/inadynsvc
is supposed not to show any output. That script is quite simple; it tries to kill anyway the "inadyn" service, thus if there is no inadyn you get an error that no inadyn was terminated. If there was actually an inadyn running, then you do not get any message.

/have not used dialup for quite some time.

Peter (nitep) said : #42

Hi Simos,
All I know is to go to system-->administration-->network
which takes you to network settings.
This has a wired connection option or a modem connection option where I had ticked the modem connection option and filled in the details of phone number, user name, password etc. It was all done in the GUI screen.
The network files are as follows
========================
/etc/network/if-down.d
/etc/network/if-down.d/avahi-autoipd
/etc/network/if-down.d/clamav-freshclam-ifupdown
/etc/network/if-down.d/wpasupplicant

/etc/network/if-post-down.d
/etc/network/if-post-down.d/avahi-daemon
/etc/network/if-post-down.d/inadynsvc
/etc/network/if-post-down.d/wireless-tools
/etc/network/if-post-down.d/wpasupplicant

/etc/network/if-pre-up.d
/etc/network/if-pre-up.d/wireless-tools
/etc/network/if-pre-up.d/wpasupplicant

/etc/network/if-up.d
/etc/network/if-up.d/avahi-autoipd
/etc/network/if-up.d/avahi-daemon
/etc/network/if-up.d/clamav-freshclam-ifupdown
/etc/network/if-up.d/inadynsvc
/etc/network/if-up.d/mountnfs
/etc/network/if-up.d/ntpdate
/etc/network/if-up.d/wpasupplicant
===================================
The clamav files should not be there as I uninstalled it some time ago.
Regards
Peter

Simos Xenitellis  (simosx) said : #43

Hi Peter,

You are using the correct way to start/stop the dialup connection.
The dialup connection is essentially a "PPP" connection, and there is a bit of extra info here.
Have a look at

/etc/ppp/

You will notice an extra set of subdirectories named as ip-up.d and ip-down.d which you can put there scripts similar to those from /etc/network.

What you can try is to place those files we put in /etc/network to the corresponding subdirectories in /etc/ppp/

Peter (nitep) said : #44

Yes. Success at last! Thankyou very much Simos. I will update the previous summary and put it below for you to check then send it to OpenDNS and to Ubuntu to put in their help files. This may encourage schools and parent to switch to Ubuntu if they can confidently protect their children as they can with you information.

Thanks again
Peter

Summary coming soon

Peter (nitep) said : #45

The summary
-----------------------------------------------------------------------
The following information was kindly supplied by Simos Xenitellis
You can use OpenDNS to block porn, phishing, domains such as some chat rooms etc. to keep your computer safe for your children, grandchildren etc.

To get OpenDNS to work with Ubuntu set the DNS servers to OpenDNS instead of the DNS servers that are provided from your ISP.
These are
208.67.222.222
208.67.220.220

The instructions are at
http://www.opendns.com/start/ubuntu.php
===========================================================================
If you keep losing these new DNS settings then a quick and dirty work-around is to set the values of /etc/resolv.conf to what we need, as follows

sudo gedit /etc/resolv.conf

    and then run

sudo chattr +i /etc/resolv.conf

This command will make the file read-only. I mean really read-only, so nothing can touch/change the file.
To change it back to normal (assuming you do not need OpenDNS anymore), run the same command with "-i" instead of "+i".
===========================================================================

If your ISP gives a dynamic IP then you need a program to update your IP at OpenDNS.
A good one is Inadyn.

The following will download the source code and compile it on your computer.
Do the following in a terminal. You can copy these commands and paste them in the terminal one at a time.

1.
wget https://www.opendns.com/support/ddns=files/inadyn.source.v1.99.zip

2.
unzip -a inadyn.source.v1.99.zip

3.
cd inadyn.source.v1.99/

4.
sudo apt-get install build-essential

5.
sudo apt-get install libcurl3-openssl-dev

6.
make

7.
gedit inadyn.conf
here put your OpenDNS information (username, password) the alias is ignored. Also add the line

--background

Make sure on the OpenDNS settings you enable "Set Up a Dynamic IP".

8.
sudo cp inadyn.conf /etc/
sudo cp bin/linux/inadyn /usr/local/bin/

9.
usr/local/bin/inadyn

Once you run step 9, you will get the result

INADYN: Started 'INADYN version 1.99' - dynamic DNS updater.
I:INADYN: IP address for alias 'Office' needs update to '1.2.3.4'
I:INADYN: Alias 'Office' to IP '1.2.3.4' updated successful.

This means that you can run manually and correctly this process.
===========================================================================

To have Inadyn start automatically at boot up time.

11.
sudo gedit /etc/network/if-up.d/inadynsvc

12.(Copy and paste the following into the editor)

#!/bin/sh

if [ ! -x /usr/local/bin/inadyn ]; then
        exit 0
fi

if [ ! -r /etc/inadyn.conf ]; then
        exit 0
fi

if [ "$METHOD" = loopback ]; then
        exit 0
fi

# Terminate any existing inadyn services running.
/usr/bin/killall -TERM inadyn

/usr/local/bin/inadyn

exit 0

13. Save and exit the editor

14.
sudo gedit /etc/network/if-post-down.d/inadynsvc

15. (Copy and paste the following into the editor)

#!/bin/sh

if [ ! -x /usr/local/bin/inadyn ]; then
        exit 0
fi

if [ ! -r /etc/inadyn.conf ]; then
        exit 0
fi

if [ "$METHOD" = loopback ]; then
        exit 0
fi

# Terminate any existing inadyn services running.
/usr/bin/killall -TERM inadyn

exit 0

16. Save and exit the editor

17. To make these files executable

sudo chmod 755 /etc/network/if-up.d/inadynsvc
sudo chmod 755 /etc/network/if-post-down.d/inadynsvc

18. If you are using dialup then do these further 2 steps

sudo cp /etc/network/if-up.d/inadynsvc /etc/ppp/ip-up.d/inadynsvc
sudo cp /etc/network/if-post-down.d/inadynsvc /etc/ppp/ip-down.d/inadynsvc

19. To see if inadyn is responding, click on System/Administration/System Log
Then, from all logs, click on /var/log/user.log, and the last entries should mention how inadyn is doing.
===========================================================================

Best Simos Xenitellis  (simosx) said : #46

Hi Peter. That's an excellent summary. Looks good to me.

Feel free to also post at the Tips section at
http://ubuntuforums.org/forumdisplay.php?f=100

Peter (nitep) said : #47

See you later Simos

Peter (nitep) said : #48

Thanks Simos Xenitellis, that solved my question.

tmosprmo (tmosprmo) said : #49

Thank you Peter & Simon--i just followed all your instructions (except the part for people using dialup) and noticed some mistakes.

First, in line 1, the address is not correct: it says wget https://www.opendns.com/support/ddns=files/inadyn.source.v1.99.zip

But it should say: wget https://www.opendns.com/support/ddns_files/inadyn.source.v1.99.zip

(the difference is "ddns=files" should be "ddns_files")

Also, this may be my mistake, but the following lines did not work for me:

Line 9, where it says usr/local/bin/inadyn shouldn't it say /usr/local/bin/inadyn ??
I got an error without the initial forward slash

When I ran line 9 without the forward slash, I got an error message (no such file)
When I ran line 9 with the forward slash, I got no confirmation as you described. Just nothing seemed to happen.

I changed my network ip address by resetting my router, ran the inadyn command, and still failed to see the address updated in my opendns dashboard.

But I also restarted my linux server and then the opendns ip address appeared to update automatically when the server came back online.

Thank you so much for doing all this work. Will this periodically update the ip address without having to reboot my server? Because my ip address appears to be changed pretty frequently by my isp.

Peter (nitep) said : #50

Hi tmosprmo
You are correct that line 1 should have _ where the = is.
line 9 should be

/usr/local/bin/inadyn

This command is only to check that you have inadyn in the correct place.
Try ( sudo nautilus ) and go to that directory to see if inadyn is there.
On my computer when inadyn is started manually as in line 9 it stays running and will this periodically update the ip address sleeping for 3 minutes in the meantime. You can see it running in the system monitor. When it is started by the auto process it only appears to run once. When I reconnect it reruns without have to reboot. This works fine for dialup where my IP only changes on connect. Simon might have an idea on how you can keep iadyn running from bootup.
Regards
Peter

Peter (nitep) said : #51

A comment for Simon
Tthe Tips section at
http://ubuntuforums.org/forumdisplay.php?f=100
would not allow me to start a thread with the summary. It could have been an automatic rejection because of the word pornography in it?
I have sent the summary to OpenDNS
Regards
Peter

Peter (nitep) said : #52

The corrected summary and more is now at
http://ubuntuforums.org/showthread.php?t=566698

tmosprmo (tmosprmo) said : #53

one correction to what i said before--although you can use apt-get to install inadyn, it is not configured to work with opendns therefore you have to use the version of inadyn supplied by opendns, as Peter & Simos explained.

P&S: your instructions seem to work great, thank you. i read the other instructions on ubuntu forums and beware, there are some minor typos in links that will make it hard for people to follow along without the need to make corrections. also, one other minor error--people who use broadband also mostly have dynamic ip addresses, so they will need inadyn also. I copied /us/local/bin/inadyn to hourly.cron to make sure it updates periodically. not sure what i am doing when i hack around with things like that but it seems to work, automatically updating my opendns ip address without rebooting the server.

thanks

Waleed Harbi (waleed-harbi) said : #54

LinkedIn
------------

I'd like to add you to my professional network on LinkedIn.

- Walid

Walid Harbi
Research Systems Specialist at Research Computing Center(R&D) at KAUST
Saudi Arabia

Confirm that you know Walid Harbi:
https://www.linkedin.com/e/-hyoxix-h6nm28s2-16/isd/8477067962/xwOM-kWh/?hs=false&tok=1I4WDKH5JKuBo1

--
You are receiving Invitation to Connect emails. Click to unsubscribe:
http://www.linkedin.com/e/-hyoxix-h6nm28s2-16/F_lu_I0PzYeTANMzr-AUxIYyz6NLvd2HzzSn4IIckPwhpoSArzFF/goo/question13218%40answers%2Elaunchpad%2Enet/20061/I2850198879_1/?hs=false&tok=08OPvUXHZKuBo1

(c) 2012 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA.