Help needed error cannot resolve destination host

The script at the end of this post worked for me - nothing else!
It’s a good solution though.