-2

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.

UPDATE:

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 -> port:80, TCP.

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 nochg response.

My script:

  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

I ran 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.

Update:

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.

  • 1
    Did you make a DNS entry for both the www version and the non-www version? If you made only an entry for www then nothing in the wilds of the internet is going to figure out what corresponds to the non-www version of the URL. – Brick Sep 18 '17 at 15:06
  • 1
    Also, this really has nothing specific to do with Raspberry Pi. You might do better at Server Fault or Super User. – Brick Sep 18 '17 at 15:07
1

You need to clarify exactly what you mean by "it fails". Can you not locate the IP address or your server, or is it failing to pull up the appropriate web pages? Based on your comment that "www.my_website.com" works, but "my_website.com", it sounds like you have configured the apache virtual host incorrectly. Apache (and other web servers) allow you to host multiple virtual hosts on a single IP, differentiating between them based on the URL by which they are called. In your case, it sounds like you have "www.my_website.com" configured, but not "my_website.com". There are options for defaults that you might want to look into as well.

It's worth noting that this is a Apache issue, and not a Raspberry Pi issue.

  • 1
    FWIW, I agree that this is not a Raspberry Pi issue, but it looks to me like he set the DNS wrong in the first place. I doubt that this is even reaching his Pi in the first place. (Additional comments under the question.) – Brick Sep 18 '17 at 15:30
  • 1
    @Brick - on re-read, I agree. Hoping someone provides a better answer so mine can sink into oblivion. – bobstro Sep 18 '17 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.