Recently I made a portfolio website that is hosted my Pi and domain from google. It was working fine (reaching it from external and internal networks) until 48 hours ago, suddenly I get one of the two following messages:
1- ERR_NAME_NOT_RESOLVED 2- ERR_INTERNET_DISCONNECTED
However if I put my public IP address I can reach the website (from External Network) just fine.
So when I do
www.my_website.com it works, but if I do
my_website.com it fails. Does anyone know why?
My setup details:
Pi is running Raspbian Light, I installed Apache2, PHP5, and MySQL.
All the website files are in the
html folder that Apache2 makes.
I enabled port-forwarding on the ISP website and router ->
I changed the IP assigned to Pi from 'dynamic' to 'manual' on the router.
I made a 'Synthetic record' on the Google Domain site.
I made a script to update my public IP for Google DNS server in case ISP changes my public IP, this runs hourly and I do get the
wget https://BLACKED_OUT:BLACKED_OUT@domains.google.com/nic/update? hostname=www.mossavi.com -O dns_update_results.txt echo "Last Run: `date`" >> dns_update_results.txt
What I have done so far:
Result from intoDNS website, here
sudo netstat -tlnp | grep 80 and the result was:
tcp6 0 0 :::80 ::::* LISTEN 840/apache2
I really don't know where the issue could be coming from; any help would be appropriated.
Since I am hosting it on Raspberry Pi and the site was reachable before, I imagined the problem is with my Pi setup or something. I found out that there was two problem one ISP, for some reason sometimes they would block incoming traffic, two 'naked URLs' were also the problem. I added a 'sub-domain forward on DNS' config page on Google, which also fixed the problem of working when someones puts a domain name with 'www', vs when they do not have it. This is a temporary fix and I will look at how my Apache is configureed, and after everyone who responded to this post reads this update, I will move the post.