dynamic dns

Discussion in 'Computing and Networks' started by Mathematics!, Apr 29, 2010.

  1. Mathematics!

    Thread Starter Senior Member

    Jul 21, 2008
    I have a DDNS account

    But I cann't find the setting in my router so It will enable DynDNS.org etc

    My older router had this setting.

    the router i currently have is linksys model model BEFW11S4

    it doesn't and i have check it's manual online and it doesn't seem to have anything in it related to dynamic dns settings ?

    Does anybody know if their is a firmware update for this to have that setting????

    I need a way of telling the router to inform my dynamic dns account of the changing ip address that comcast is giving my thru their dhcp servers.

    The last thing I want to do is have to install software on a specfic machine to do it.

    this is really bugging me
    has anybody done this or know a hidden secret about this router.
    Normally I would just have to enable the dyndns setting in my router
    enter my username/password and my dydns domain name click apply.
    And I would be done.... so this really sucks if the router cann't do it in someway.
    Their must be something ahhhhhhhhhhhhhhhhhhhhhhhhh
  2. studiot

    AAC Fanatic!

    Nov 9, 2007
    You should set the DNS in your computer, not the router.
  3. Mathematics!

    Thread Starter Senior Member

    Jul 21, 2008
    no, I am not talking about dns I am talking about dynamic dns.

    I need someway to inform the dynamic dns site that my ip has changed.
    Usually I did it thru a router setting.

    I don't see how changing a dns server setting on a computer will inform the site that they need to update my domain name with my new ip address.?????

    Note I don't have a static ip it is just dynamically uptained from comcast dhcp server ( not willing to pay for a static ip or host on godaddy or something..)

    Thanks most routers I have worked with have this setting somewhere ???
  4. retched

    AAC Fanatic!

    Dec 5, 2009
    The computer doesn't care what your IP has changed to. It can hit the internet regardless.

    So, a cron job on one of your boxes will visit a site like whatsmyip.com and the site will post your IP. The cron "reads" your IP and sets the dynamic DNS settings like this.

    It can be set to check every day, week, year, 30 seconds, or whatever.

    This is what I do when I have a project with no static IP.

    I highly recommend it.

    You can also use the same cron job to check the router for its current assigned IP, but this us much more difficult.
  5. Mathematics!

    Thread Starter Senior Member

    Jul 21, 2008
    Ya, if it is not in my router how do you do this quote???
    How did you do that?

    your computer goes out to their site on a specfic port to inform them or something. is their a certain protocal/port they are using for this???
  6. retched

    AAC Fanatic!

    Dec 5, 2009
  7. Mathematics!

    Thread Starter Senior Member

    Jul 21, 2008
    Ok , I downloaded the ddclient on my ubuntu machine.

    I followed their directions in the site and on the read me file.

    I.E I created the /etc/ddclient/ddclient.conf
    created and copied the ddclient to the usr/sbin
    create the folder cache file/folder

    Just have a couple of last questions.

    I used the default settings for my ddclient.conf
    it has this in it

    Code ( (Unknown Language)):
    2. # /etc/ddclient/ddclient.conf
    3. #
    4. protocol=dyndns2
    5. use=web
    6. login=mylogin
    7. password=mypassword
    8. myhost.dyndns.org
    Obviously I changed the lines to me login , my password , and the bottom line to my domain that dynamic dns gave me. If I had multply ones I could just add , next.domain.com ,...etc

    But when I was reading thru their list of key values you can use I have a few question on them.

    First for this file to work don't I also have to specify a server=www.dyndns.com or something at least some way of telling it where to login to the site.... ??? ( in their example conf files some do some don't I am wondering if this is nessary in my case or when the server= is nessary to use???

    The next thing I am try to figure out is what the best way to have this daemon startup at startup when the machine turns on???
    Also I would like it if I could set the time for this daemon to check for a new ip to update if one is found.

    I am under the impression that the daemon is default = 0 so does this mean
    it will only check once when the computer is booted up but if the computer is left on it won't check again until a reboot?
    If so I could set the deamon = 600 or something in the conf file if that is true.

    Correct me if I am wrong.

    Thanks for any help with this stuff.
    Curious what the protocal is because if it is just connecting to a specific port with a socket and giving the login , password , server-info stuff then I could have written my own small program for that.
    Last edited: Apr 30, 2010
  8. retched

    AAC Fanatic!

    Dec 5, 2009
    You absolutly could have written your own program. this uses port 80.

    It ONLY contacts a website that DISPLAYS your IP. It does a "screen grab" and takes your IP off of it.

    Then the ddclient updates a local file with the new IP.
    yes I use checkip.dyndns.com

    This ONLY displays a few words, Which you choose to ignore in your software, then YOUR current IP. So grab that IP and set the CONFIG.

    Here is a ddconf config file to help in the dyndns.com site:
  9. Mathematics!

    Thread Starter Senior Member

    Jul 21, 2008
    Well, I can write a program to obtain my current Wan ip address in many way's
    In about a few seconds.

    My problem is after my daemon has the current ip address. How does their ddclient update the ip on the dyndns site. Is it just connecting to http port 80
    and isssueing a GET HTTP with the varibles in the configure file added to the get request?

    If that is all it is I can just write a simple java socket program to do this in no time.

    I am just wondering if they are using port 80 and the http protocal to actually update the ip on their site I already know how to obtain my wan ip that is the easy part. I am assuming when I set the varibles in the GET request they are of the exact form as the ddclient.conf file has them in....
    i.e varible = value

    Anyway my config file looks like this
    Code ( (Unknown Language)):
    2. # /etc/ddclient/ddclient.conf
    3. #
    4. daemon=600
    5. syslog=yes
    6. mail=root
    7. mail-failure=root
    8. pid=/var/cache/ddclient/ddclient.pid
    9. server=members.dyndns.org
    10. protocol=dyndns2
    11. use=web, web=checkip.dyndns.com/, web-skip='IP Address'
    12. login=mylogin
    13. password=mypassword
    14. myhost.dyndns.org
    15. #no mail mx register stuff I need to set yet maybe later
    Am I missing anything just a double check think I got everything I need in it.

    I said for the way of obtaining ip use web and I am using their default server.
    Have a few questions on 2 commands what is the custom command for how is that different then a domain name listed with out the custom tag infront of it.

    Also what is wildcard=yes mean I see it used some time but I don't know what a wildcard for CNAME actually does in a DNS record?

    And my last main question is what is the best way to have this ddclient run on startup of my machine. I know in windows I would just put it in my startup folder but what is the proper/best way of doing it in linux.

    Last edited: Apr 30, 2010
  10. retched

    AAC Fanatic!

    Dec 5, 2009
    The wildcard is for if you are using *.math.com for
    or if anyone types any prefix it will route to the box you have assigned.

    Then you can use virtual domains to route the different requests to different boxes or different folder in your WWW directories.

    In linux the best way is to use a cronjob. Set up the cron to run every boot.

    Your config file looks good. As for how ddclient talks to the dynamic DNS sites, I dont know which port is used. I would think it would be a standard GET.

    You may want to se if there is a ddhost, or something along those lines, that dyndns.com and other dynamic DNS sites run to get the info. This is all open source so it shouldnt be tough.

    The sourceforge page for ddclient is probably a good start.
  11. Mathematics!

    Thread Starter Senior Member

    Jul 21, 2008

    I am learning about how the cron jobs are set up.
    And from what I know and did.

    I did this
    crontab -e
    selected option 2 edit with nano
    then put the line
    @hourly /usr/sbin/ddclient -daemon 300 -syslog

    But what I am wondering now is when I start the machine up and it executes this cron job to execute every hour does that mean if the daemon is running then it is going to create another daemon instance every hour.

    My objective is to only have one instance of ddclient running but for it to check if the ip is changed every hour. I was thinking I would just use the daemon=600 command in the ddclient.conf and modify it to 3600 <- run check every hour.

    So maybe the correct cron job would be @reboot /usr/sbin/ddclient -daemon 300 -syslog and used the daemon command in the ddclient.conf to set how often it checks for ip updates. That way any time I boot the ddclient is executed once and the config file tells that instance to check every hour.

    Is that what you did. Seems like the correct way to go.
    Sorry if I am making this seem harder then it is .
    It is just me first time at some of this setup stuff I was a windows super user for years and years but now I switch over to linux because I like the fact you have complete control over every little detail.

    Thanks for your help. (this is definitely the way to go if your router doesn't support dyndns )

    As for the protocal that dyndns uses to update the your changing ip ... looking thru the code I believe it was just issueing an HTTP GET command and placing the parameters of the ddclient.conf into the HTTP request header. The parameter server tells it where to make the HTTP request to and the login/password validates if you are the true user of a dyndns account. After that is done it takes the rest of the parameters in either using a jsp and function getParameters , or PHP and geting th parameters with PHP functions once they have them they update the ip ,...etc with those varibles.

    Seems almost trival to write your own ddclient for this.
    Maybe I will write one to test my theory in java. That way it will be portable an useable on all machines , windows , linux , mac ,...etc.
  12. retched

    AAC Fanatic!

    Dec 5, 2009
    No, you only need it once. Not hourly.

    Once the daemon is running, IT will check for a changed IP every so often (however you set in congig for ddclient.)

    @reboot would be the way to go.

    It is trivial to write your own. But remember, ddclient is capable of more than the "text grab". It can also be used many other ways, thats why its so popular. It can edit config files and set for many different clients..

    If the way you and I are using it is all you need, then YES, it is an easy task.

    Really all it does in this instance, is visit a webpage,
    grab the IP via a text grab,
    log into the website you set (dyndns.com)
    enter your name and password
    edit your dns account
    and save.
  13. Mathematics!

    Thread Starter Senior Member

    Jul 21, 2008
    gotcha, I will see if this all works out.

    Anyway, I am on a linux machine currently but I am just wondering if their is a ddclient that runs on windows or mac version. Because I mentioned DDNS to my friend and he wanted to set it up however he is on a windows machine and directly plugged into the cable modem... (i.e he doesn't have a router only one main computer so he needs the ddclient but for it to run on windows. )

    All the downloads I see are .tar files which leads me to believe they are only for linux machines.

    Thanks for clearing my problems up
  14. rjenkins

    AAC Fanatic!

    Nov 6, 2005
    There are definitely versions for Windows, you would have to check for info on the dynamic dns site you are using.

    For one-off startup commands on Linux, the usual way of doing it is to add them to rc.local which gets run at the end of the boot sequence.

    On Redhat/Centos it's at /etc/rc.d/rc.local

    You can either add items in there directly, or preferably add you own startup script and run that from rc.local (I just call it rc.local2).

    That way it won't get replaced if the rc.local gets updated at any time.
  15. Mathematics!

    Thread Starter Senior Member

    Jul 21, 2008
    Ok , but I am using cronjobs to startup the daemon is their any reason not to use that for starting the ddclient?