Sonntag, 28. Juni 2015

Issues with ISP DNS and no-ip.org URL

The ftp upload of the images showed some problems in these days:

The DNS information for the dyndns-url of no-ip.org was not correct.

During my tests I have seen, that the only way to get rid of the wrong DNS IP's is to overwrite the dynamic DNS-information in the raspberrypi, which was automatically set by DHCP IP-adress-retrieval.

The re-write for the DNS-adress can be done in /etc/resolv.conf
BUT: the DNS-information will be automatically overwritten at each DHCP-renewal or reboot of the raspberrypi.

Solution:
I created a small shell-script, which does the following:
- create a copy of the resolv.conf, without the "nameserver" information
- add the nameserver 8.8.8.8 to resolv.conf
- replace the original resolv.conf with the modified one


#!/bin/bash
cat /etc/resolv.conf | grep -v nameserver > /etc/resolv.conf.new
echo "nameserver 8.8.8.8" >> /etc/resolv.conf.new
mv /etc/resolv.conf.new /etc/resolv.conf


This script will be executed now, before the ftp-upload starts.

Keine Kommentare:

Kommentar veröffentlichen