The pfSense Store

Author Topic: Custom Dynamic DNS  (Read 9570 times)

0 Members and 1 Guest are viewing this topic.

Offline ermal

  • Administrator
  • Hero Member
  • *****
  • Posts: 3357
    • View Profile
Re: Custom Dynamic DNS
« Reply #15 on: September 13, 2010, 09:26:33 am »
Please clarify the license of this(mostly if they can be committed to the repo).
I do not agree totally with this patches and will make some modifications of them:

Offline BlueMatt

  • Jr. Member
  • **
  • Posts: 44
    • View Profile
Re: Custom Dynamic DNS
« Reply #16 on: September 13, 2010, 09:42:33 am »
Have fun do what you want - I do not claim any copyright to the above patches.

Offline Zappza

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Custom Dynamic DNS
« Reply #17 on: September 19, 2010, 04:04:27 am »
Hi!
While you are modifying the DDNS behavior, is it possible to add OpenVPN as an interface? I am using OpenVPN as a Client, and I am routing all my traffic through a public VPN provider. I am solving the DDNS issue now by using the DynDNS client on a server connected to the LAN, but of course, the ideal thing is to use pfSense for this.

Thanks!

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 14935
    • View Profile
Re: Custom Dynamic DNS
« Reply #18 on: September 19, 2010, 05:02:33 pm »
Zappca,

Have you tried assigning your openvpn instance as an OPT interface? (assign it, enable it, select "none" for the IP type)

It may do what you want then.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline Zappza

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Custom Dynamic DNS
« Reply #19 on: September 19, 2010, 05:34:53 pm »
Unfortunatly it does not. I tried assigning the interface to the ovpnc1 port, but the DNS client was not able to retrieve the IP adress that OpenVPN was connected to. The adress reported back was 0.0.0.0.

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 14935
    • View Profile
Re: Custom Dynamic DNS
« Reply #20 on: September 19, 2010, 05:36:19 pm »
Then it may be covered by the changes I've suggested here: http://redmine.pfsense.org/issues/904

May not happen for 2.0 though.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline BlueMatt

  • Jr. Member
  • **
  • Posts: 44
    • View Profile
Re: Custom Dynamic DNS
« Reply #21 on: September 22, 2010, 12:54:47 pm »
I've updated the patches to fix a couple bugs I've been seeing on the previous patches.
1.  Because of the lines
Code: [Select]
if (!empty($int))
break;
in services.inc, only one dyndns provider will be updated per interface if services_dyndns_configure is called with an interface (it usually is), this is a bug in pfSense, and is unrelated to my particular patch, but effects all users of multiple dyndns providers on one interface (or should as far as I can tell).  

2. One of my providers automatically pings my IP Address to make sure it is up before allowing updating (tunnelbroker.net) thus /etc/inc/interfaces.inc had to be changed to allow filter_configure to happen before serivces_dyndns_configure.  I added a sleep(1) to make sure the reload is done.  

All other previous issues still apply.  

Zappza:  I don't use OpenVPN on my installation, so I don't know how pfSense handles the interfaces of it.  If you could send an output of ifconfig -a (or at least the relevant parts) and the list of interfaces according to the webUI, I'll try to add it if I have time.

New Patches are attached and can be applied through
Code: [Select]
patch /usr/local/www/services_dyndns.php < services_dyndns.php.txt
patch /usr/local/www/services_dyndns_edit.php < services_dyndns_edit.php.txt
patch /etc/inc/dyndns.class < dyndns.class.txt
patch /etc/inc/services.inc < services.inc.txt
patch /etc/inc/interfaces.inc < interfaces.inc.txt

Again, I claim no copyright on the above patches, or anything posted previously.

Offline BlueMatt

  • Jr. Member
  • **
  • Posts: 44
    • View Profile
Re: Custom Dynamic DNS
« Reply #22 on: September 22, 2010, 02:17:41 pm »
I'm sorry, my last post not fully tested.

In addition to the modification of interfaces.inc, rc.newwanip had to be updated in order to make sure that the filter is reloaded before dyndns is updated.  (I'm only really assuming that interfaces.inc needs modification, I've only tested the updates through disconnect/connect on the webui, but it is called by several other functions in interfaces, so to be safe I'm going to leave it modified.)
So with rc.newwanip, use
Code: [Select]
patch /usr/local/www/services_dyndns.php < services_dyndns.php.txt
patch /usr/local/www/services_dyndns_edit.php < services_dyndns_edit.php.txt
patch /etc/inc/dyndns.class < dyndns.class.txt
patch /etc/inc/services.inc < services.inc.txt
patch /etc/inc/interfaces.inc < interfaces.inc.txt
patch /etc/rc.newwanip < rc.newwanip.txt
to patch. 

This time I tested the patches against the latest snapshot and they work.

As always, I claim no copyright to any of the above. 

Offline BlueMatt

  • Jr. Member
  • **
  • Posts: 44
    • View Profile
Re: Custom Dynamic DNS
« Reply #23 on: September 30, 2010, 12:30:40 pm »
Is there a chance this will make it into 2.0, or is there anything that needs changed before possible inclusion, or has this just fallen under bug fixes get first priority and there is a lot left to do?

Thanks for the great project.

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 14935
    • View Profile
Re: Custom Dynamic DNS
« Reply #24 on: September 30, 2010, 12:39:24 pm »
If ermal gets a chance to look them over and offer feedback/fixes, they may make 2.0.

If it doesn't, it should be easy enough to whip up a package to add in the patches, but that couldn't really happen 100% until 2.0 is out since files are moving targets until then.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline BlueMatt

  • Jr. Member
  • **
  • Posts: 44
    • View Profile
Re: Custom Dynamic DNS
« Reply #25 on: October 01, 2010, 11:32:11 am »
One more bug in the existing code: line 587 in /etc/inc/services.inc should be return, not continue.
This can cause an error when a DynDNS Service is disabled.

Offline BlueMatt

  • Jr. Member
  • **
  • Posts: 44
    • View Profile
Re: Custom Dynamic DNS
« Reply #26 on: October 08, 2010, 08:40:56 am »
One more bug in the existing code: line 587 in /etc/inc/services.inc should be return, not continue.
This can cause an error when a DynDNS Service is disabled.
This bug causes the following error on a page which reconnects an interface:
Code: [Select]
Fatal error: Cannot break/continue 1 level in /etc/inc/services.inc on line 587

Offline Zappza

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Custom Dynamic DNS
« Reply #27 on: October 22, 2010, 04:18:57 pm »
Hello!
Here is a pastebin of ifconfig -a.

I did get it to report the correct IP when listening to the LAN interface, but it didn't appear to update the entry properly.

Thanks!

http://pastebin.com/cnsXXRHg

Offline David Szpunar

  • Full Member
  • ***
  • Posts: 165
    • View Profile
    • David Szpunar
Re: Custom Dynamic DNS
« Reply #28 on: February 06, 2011, 10:01:35 pm »
One option I can think of as well is to be able to update http://www.dnsomatic.com/ from pfSense, which will in turn update many other dynamic IP services. Maybe the existing system will work with it, I think they use a similar API to existing providers to make it easy to use them as a drop-in replacement. But I'm not a dynamic DNS API expert, just a suggestion.
David Szpunar
I use pfSense wherever I can, and I break the rule about not using 2.0 beta in production, because it's so cool :-)

Offline BlueMatt

  • Jr. Member
  • **
  • Posts: 44
    • View Profile
Re: Custom Dynamic DNS
« Reply #29 on: February 20, 2011, 06:52:07 am »
Its a great idea, and I do use dnsomatic from time to time, however the site (including the list of supported services) hasn't been touched in years, and I needed several other services (including one custom designed one) to be automatically updated.