Custom DNS not updating (Fixed!)
-
Hello,
I recently updating to PFSense 2.02 Release and I don't know if that has any affect on my issue.
Issue: My current Dynamic DNS for DYNDNS (custom) and ZoneEdit are both not updating with my new ip and have the stale cached ip in "red".
Apparently this morning sometime my ip changed but both of the DYNDNS entries are still showing my old cached ip from yesterday (01/22/12).
I did check the other forums first before I posted.
Troubleshooting done so far after reading other forum posts:
1. I checked to make sure I had a public ip address and not a private one
2. Made sure that my DynDNS entires were not disabled after the upgrade from 2.0.1 to 2.0.2
3. Checked the logs related to "dyndns" using the "dyndns" as the filter word on the System Logs screen.
I have a few logs showing successful updates then all of a sudden it just fails with a generic php: : Curl error occurred: Couldn't resolve host 'members.dyndns.org'
I have read the forums and even posted in IRC with no help so can someone please possible point me in the correct direction.
I know if I click the entries and save this will force an update but then its looses the whole automation of using dynamic dns.
The logs have been attached with my domain name and ip changed but still relivent information.
Thanks
Jan 23 04:34:59 php: : Curl error occurred: Couldn't resolve host 'members.dyndns.org' Jan 23 04:34:59 php: : DynDns: Current Service: dyndns-custom Jan 22 01:01:01 php: : phpDynDNS: updating cache file /conf/dyndns_wandyndns-custom'DomainNameDynDns.org'.cache: 97.228.64.127 Jan 22 01:01:01 php: : DynDns: Current Service: dyndns-custom Jan 10 11:30:20 check_reload_status: Updating all dyndns Jan 10 11:22:11 php: /services_dyndns_edit.php: phpDynDNS: (Success) IP Address Updated Successfully! Jan 10 11:22:11 php: /services_dyndns_edit.php: phpDynDNS: updating cache file /conf/dyndns_wanzoneedit'websiteURL.org'.cache: 97.228.64.127 Jan 10 11:22:11 php: /services_dyndns_edit.php: DynDns debug information: 97.228.64.127 extracted from local system. Jan 10 11:22:11 php: /services_dyndns_edit.php: DynDns: Current Service: zoneedit Jan 10 11:22:11 php: /services_dyndns_edit.php: DynDns: DynDns _checkStatus() starting. Jan 10 11:22:09 php: /services_dyndns_edit.php: DynDns: DynDns _update() starting. Jan 10 11:22:09 php: /services_dyndns_edit.php: DynDns debug information: DynDns: cacheIP != wan_ip. Updating. Cached IP: 0.0.0.0 WAN IP: 97.228.64.127 Jan 10 11:22:09 php: /services_dyndns_edit.php: DynDns: Current WAN IP: 97.228.64.127 Cached IP: 0.0.0.0 Jan 10 11:22:09 php: /services_dyndns_edit.php: DynDns debug information: 97.228.64.127 extracted from local system. Jan 10 11:22:09 php: /services_dyndns_edit.php: DynDns: updatedns() starting Jan 10 11:18:02 php: /services_dyndns_edit.php: phpDynDNS: (Unknown Response) Jan 10 11:18:02 php: /services_dyndns_edit.php: phpDynDNS: PAYLOAD: <error code="701" text="Zone is not set up in this account." host="websiteURL.org"> Jan 10 11:18:02 php: /services_dyndns_edit.php: DynDns: Current Service: zoneedit Jan 10 11:18:02 php: /services_dyndns_edit.php: DynDns: DynDns _checkStatus() starting. Jan 10 11:18:02 php: /services_dyndns_edit.php: DynDns: DynDns _update() starting. Jan 10 11:18:02 php: /services_dyndns_edit.php: DynDns debug information: DynDns: cacheIP != wan_ip. Updating. Cached IP: 0.0.0.0 WAN IP: 97.228.64.127 Jan 10 11:18:02 php: /services_dyndns_edit.php: DynDns: Current WAN IP: 97.228.64.127 Cached IP: 0.0.0.0 Jan 10 11:18:02 php: /services_dyndns_edit.php: DynDns debug information: 97.228.64.127 extracted from local system. Jan 10 11:18:02 php: /services_dyndns_edit.php: DynDns: updatedns() starting Jan 10 11:17:44 php: /services_dyndns_edit.php: phpDynDNS: (Unknown Response) Jan 10 11:17:44 php: /services_dyndns_edit.php: phpDynDNS: PAYLOAD: <error code="701" text="Zone is not set up in this account." host="websiteURL.org"> Jan 10 11:17:44 php: /services_dyndns_edit.php: DynDns: Current Service: zoneedit Jan 10 11:17:44 php: /services_dyndns_edit.php: DynDns: DynDns _checkStatus() starting. Jan 10 11:17:40 php: /services_dyndns_edit.php: DynDns: DynDns _update() starting. Jan 10 11:17:40 php: /services_dyndns_edit.php: DynDns debug information: DynDns: cacheIP != wan_ip. Updating. Cached IP: 0.0.0.0 WAN IP: 97.228.64.127 Inital update. Jan 10 11:17:40 php: /services_dyndns_edit.php: DynDns: Current WAN IP: 97.228.64.127 No Cached IP found. Jan 10 11:17:40 php: /services_dyndns_edit.php: DynDns debug information: 97.228.64.127 extracted from local system. Jan 10 11:17:40 php: /services_dyndns_edit.php: DynDns: updatedns() starting Jan 6 11:13:36 check_reload_status: Updating all dyndns Dec 27 01:01:00 php: : phpDynDNS: updating cache file /conf/dyndns_wandyndns-custom'replaced_name_dyndns.org'.cache: 97.228.64.127 Dec 27 01:01:00 php: : DynDns: Current Service: dyndns-custom</error></error> ```[dyndns_pfsense_logs.txt](/public/_imported_attachments_/1/dyndns_pfsense_logs.txt)
-
Never mind I solved my own issue.
I'm posting the solution here in case anyone else runs into this.
Basically what happens is that once your WAN IP changes PFSense checks it against the current cached Dynamic DNS IP.
If these values dont match then the cached IP is displayed in "red". This means that PFSense knows the cached IP is incorrect.
There is then a cron job that is scheduled to run at 1:01 AM by default located here```
/etc/crontabWhere chrontab is the actual file and /etc is the path. Inside of the crontab are various cron jobs that are set to run at set schedules. This looks like what is displayed below:
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
HOME=/var/log
#minute hour mday month wday who commandpfSense specific crontab entries
Created: January 10, 2013, 11:30 am
0 * * * * root /usr/bin/nice -n20 newsyslog
1,31 0-5 * * * root /usr/bin/nice -n20 adjkerntz -a
1 3 1 * * root /usr/bin/nice -n20 /etc/rc.update_bogons.sh
*/60 * * * * root /usr/bin/nice -n20 /usr/local/sbin/expiretable -v -t 3600 sshlockout
1 1 * * * root /usr/bin/nice -n20 /etc/rc.dyndns.update
*/60 * * * * root /usr/bin/nice -n20 /usr/local/sbin/expiretable -v -t 3600 virusprot
*/60 * * * * root /usr/bin/nice -n20 /usr/local/sbin/expiretable -t 3600 snort2c
*/5 * * * * root /etc/ping_hosts.sh
*/140 * * * * root /usr/local/sbin/reset_slbd.sh
30 12 * * * root /usr/bin/nice -n20 /etc/rc.update_urltablesIf possible do not add items to this file manually.
If you do so, this file must be terminated with a blank line (e.g. new line)
The Line``` 1 1 * * * root /usr/bin/nice -n20 /etc/rc.dyndns.update ```is what we are interested in for this problem. Interrupting this line basically says: At 1:01 AM (What the first 1 is minute and the second 1 is hour so 1:01) update the Dynamic DNS Provider with the WAN IP Address. So in essence if your IP Address for Dynamic DNS is incorrect and shown in red on the Dynamic DNS Page this will be updated at 1:01 AM. For me personally everyday at 1:01 is wayyyyy to long to wait for my IP Address to be corrected. So for the solution I chose to change the time of the scheduled Cron job to every 15 mins. This might not be the optimal time for everyone (some may want faster like every 5 mins some slower like every 1 hour) . The change is easy and shown below by editing the time on the line specified. If you want every x minutes you can use the */x where x is the number of minutes so for example. */15 = every 15 minutes */45 = every 45 minutes.
*/15 * * * * root /usr/bin/nice -n20 /etc/rc.dyndns.update
The code above will run the Cron job for Dynamic DNS every 15 minutes. So in essence if your ip address on the WAN interface changes in 15 mins your Dynamic DNS provider should be updated with the appropriate change. Also if you want to look at the log specific for Dynamic DNS Updates run the following command either using something like Putty connected via SSH or you can run commands in the webgui under Diagnostics -> Command. I recommend a SSH session as the output will probably look better than in the webgui. Command:``` clog /var/log/system.log | grep -i dyndns
If you would like to output the output of this command into a file use the following command. Where /tmp is the tmp directory and filename is the name you want the file called.
clog /var/log/system.log | grep -i dyndns > /tmp/filename ```. If you would like to use a graphical tool in order to access and edit the files on PFSense I recommend Win SCP. A quick Google search can show you how to configure and setup. I will say if using WinSCP make sure to use "root" as the username and your normal password as the password.
-
Note: If you directly edit /etc/crontab, then that will be overwritten next time you reboot. The crontab is generated from entries the pfSense config.xml
To make it permanent, install the Cron package and edit the job from there - then both config.xml and /etc/crontab get updated. -
Note: If you directly edit /etc/crontab, then that will be overwritten next time you reboot. The crontab is generated from entries the pfSense config.xml
To make it permanent, install the Cron package and edit the job from there - then both config.xml and /etc/crontab get updated.Did not know that and guess I would not have found out till months later (since I rarely reboot the box).
Thanks alot man for the help.
:)