Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Heartbeat - a dynamic DNS client / server for GANDI DNS  (Read 5083 times)

0 Members and 1 Guest are viewing this topic.

dwarfman78

  • Full Member
  • ***
  • Posts: 228
  • I'm bietzsche, Nietzsche !
    • MSN Messenger - cd4c@hotmail.com
    • View Profile
    • Email
Heartbeat - a dynamic DNS client / server for GANDI DNS
« on: February 28, 2015, 09:51:30 am »
Hi guys,

I recently used sfml-network for a custom project :

What for

As my ISP does not provide me a static public ip address and because i was not entirely satisfied with dyndns.org or no-ip solutions, i designed my own "dynamic dns client/server" using sfml-network for client/server communications / thread management and Gandi XmlRpc API for updating my domain.

How it works

(click to show/hide)

1. A client sends periodically an UDP packet to the server, telling which subdomain to update.
2. The server calls GANDI xmlRpc API to check if the ip has changed and updates the subdomain if needed.
3. I can now send a dns lookup to retrieve my public IP...
4. ... And enjoy accessing my private network, even if my public ip has changed over time.

Why SFML

it proved itself quite easy to cross compile for my router and to use it for that purpose, so i guess it wasn't a bad choice.

Security

In order to deny the update of a subdomain from unwanted clients, i've implemented a basic password based SHA-256 security.

Improvments

Currently, the hash, for a given subdomain, client and password stays the same as long as the client ip stays the same, i should add a seed of some sort to make it changes over time, making it harder to find.

The password is the same for all clients and thus for all subdomains. I should add some configuration to allow a password for each subdomain.

Unit tests...

Sources

https://github.com/dwarfman78/heartbeat-client
https://github.com/dwarfman78/heartbeat-server
« Last Edit: March 26, 2015, 09:25:01 pm by dwarfman78 »
@dwarfman78
github.com/dwarfman78

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 877
    • View Profile
Re: Heartbeat - a dynamic DNS client / server for GANDI DNS
« Reply #1 on: February 28, 2015, 02:15:26 pm »
Interesting to see some utility program. :)

The only part I don't really understand right now is the server (didn't look at the code so far). Why do you need that step? Wouldn't it be enough to talk to the DNS directly?

StormWingDelta

  • Sr. Member
  • ****
  • Posts: 365
    • View Profile
Re: Heartbeat - a dynamic DNS client / server for GANDI DNS
« Reply #2 on: February 28, 2015, 03:32:44 pm »
hmm that's odd our ISP doesn't give out a public address of that type.  Strange thing is your computer should still have its own local address and if you type ipconfig in the command line it should show you what yours is.  In any event it is nice to see more utilities like this one pop up on the forum so keep up the good work. :P
I have many ideas but need the help of others to find way to make use of them.

dwarfman78

  • Full Member
  • ***
  • Posts: 228
  • I'm bietzsche, Nietzsche !
    • MSN Messenger - cd4c@hotmail.com
    • View Profile
    • Email
Re: Heartbeat - a dynamic DNS client / server for GANDI DNS
« Reply #3 on: February 28, 2015, 04:16:57 pm »
Interesting to see some utility program. :)

The only part I don't really understand right now is the server (didn't look at the code so far). Why do you need that step? Wouldn't it be enough to talk to the DNS directly?

Indeed, the server part should be enough (with a few tweaks), you can find some python scripts or event a C version of an equivalent program on the internet.

However, i need to manage several dynamic public ip adresses (my dad's, my uncle's, a broke friend's which cannot offer himself a public domain name...). In a simple client/server configuration this would have meant  sharing my Gandi api key with them and i'm not found of that idea.

A python (or Java) based script was also out of the question because it needed to run on small devices like routers.
« Last Edit: February 28, 2015, 04:22:37 pm by dwarfman78 »
@dwarfman78
github.com/dwarfman78

dwarfman78

  • Full Member
  • ***
  • Posts: 228
  • I'm bietzsche, Nietzsche !
    • MSN Messenger - cd4c@hotmail.com
    • View Profile
    • Email
Re: Heartbeat - a dynamic DNS client / server for GANDI DNS
« Reply #4 on: February 28, 2015, 04:36:55 pm »
hmm that's odd our ISP doesn't give out a public address of that type.  Strange thing is your computer should still have its own local address and if you type ipconfig in the command line it should show you what yours is.  In any event it is nice to see more utilities like this one pop up on the forum so keep up the good work. :P

Although it is more and more common to be given a permanent public ip address, it is not always the case. I need a domain name (which is permanent) to access my private networks over the internet even if my ip is changing over time.

For example, when i'm at work i enjoy listening to my home mp3 database with my phone, how do i do that  without checking my ip every morning or if the ip changes after a power failure ?

It's the same when i need to access my uncle's network which hosts some neat game servers.

There are some free providers like dyndns and no-ip but they ask you to fill a captcha every month and some sort of manual things, i'm afraid they are going to become non free solutions in the future.
@dwarfman78
github.com/dwarfman78

dwarfman78

  • Full Member
  • ***
  • Posts: 228
  • I'm bietzsche, Nietzsche !
    • MSN Messenger - cd4c@hotmail.com
    • View Profile
    • Email
Re: Heartbeat - a dynamic DNS client / server for GANDI DNS
« Reply #5 on: March 26, 2015, 09:26:39 pm »
I've just added a changing hash over time (daily, using day of the year) and multiple password server capability (one pwd for each subdomain).
@dwarfman78
github.com/dwarfman78