Commit bf29b57d authored by vindarel's avatar vindarel

Merge branch 'master' into 'master'

Replace with a version that use the OpenNIC API

This version is a almost complete rewriting of the vindarel's original file. It use the API grab from the source web page of openNIC ( It use two type of very fast ping: ones that ping always up IP, and onother that ping notorious domain name like

Is used o lot number of IP's and domain name for safety reason and is checked the DNS get from the OpenNIC's API via a ping.

If the previous Opennic DNS/the previous DNS located in head of /etc/resolvconf.d directory are not working, we used other fall back DNS IPs like google DNS and other.

TODO?: in this wise you are able to download the opennic DNS via the API. But if the old (old session?) DNS dont't works is reasonable to try the new ones? Or is better to wait the next session when you has setted the default DNS (fall back) and you can try to download the new ones via API?

At the end is write into head of resolv.conf.d directory the Opennic DNS IPs if they are pinged, then they are checked via a ping domain name (example ping If the last ping is ok then you can start your session with working Opennic DNS. Otherwise you have a problem and my script don't go further.

It is unlike that this script fail to set DNS.

I don't like google and OpenDNS so I used other IPs, other DNS and other domain name like You can set your own like you agree.

the CLI command ping is very fast in my machine so i insert a pause of one second to slow the sequence of test. I have set the option timeout and other but w/o success so I inserted the time.sleep(1).

When this script is started for first it check the Internet connection via a iterative pinging of all TEST IP, so those servers known your IP. For privacy reason is better if TEST IP are not google IP like and or other spyware server. When your internet connection (router is on?) is up the pinging ended.

I have a 3G modem/router so when I power on my linux box my router is booted and this script wait some seconds for when the Internet is up. This script has the timeout feature: you can enlarge it.

See merge request !1
parents e4818eb5 a7427e8d
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment