Cannot rebuild app due to nameserver DNS issues "could not resolve host github.com"

AI-generated summary

User annakein is experiencing DNS issues, specifically unable to resolve github.com, when trying to rebuild their Discourse app. pfaffman suggests it’s likely a DNS or networking problem rather than a Discourse issue.

annakein shares their /etc/resolv.conf file, which includes nameservers 127.0.0.53, 8.8.8.8, and 8.8.4.4. pfaffman advises removing the other nameserver if using Google’s, as Linux may overwrite the file.

After making changes to the resolv.conf file, annakein is unsure if they need to restart Docker. pfaffman recommends testing with the curl command and then trying to rebuild the app.

annakein suspects a recent change to their SSH configuration might be the cause, but itsbhanusharma and pfaffman disagree. pfaffman suggests replacing the local DNS server with 8.8.8.8 and checking for any pending upgrades or reboots.

Lecter recommends running sudo apt-get update && sudo apt-get upgrade -y and then attempting to rebuild. pfaffman agrees that an update and reboot might solve the issue, and Lecter confirms this worked for a similar issue they experienced.

Ensuring launcher is up to date
Fetching origin
fatal: unable to access 'https://github.com/discourse/discourse_docker.git/': Could not resolve host : github.com
error: Could not fetch origin
Launcher is up-to-date

And also
curl https://github.com/ doesn’t work

Hey Anna! Sorry you’re having trouble. Either github is down, or, more likely, you have a dns or networking problem.

I found some solutions in discourse community but none of them solve my problem.

Maybe I should change my nameserver in resolv.conf but I have no idea this is right or wrong nameserver address.

nameserver 127.0.0.53
options edns0 trust-ad
nameserver 8.8.8.8
nameserver 8.8.4.4

Thanks a lot

It’s not a Discourse problem, so this isn’t the best place to look for a solution.

If you’re going to use the Google name servers then you should remove the other one. Also, in many configurations, Linux will overwrite resolve.conf, so if changing name servers fixes the problem you’ll still need to do a bit more to see that it’s actually resolved.

So you mean I might remove nameserver 127.0.0.53?

Should I do something after change nameserver in resolv.conf like rerun docker?

You can try the curl command and see if it works, and if it does, you can try to ./launcher rebuild app

I looked at my test server and found it has like this

nameserver 127.0.0.53
options edns0 trust-ad

So I followed that but still not working.

My thought is I changed /etc/ssh/sshd_config file to use ssh remote from my local PC
Changed like
PasswordAuthentication no -> PasswordAuthentication yes

Do you think this change might affect the server?

This shouldn’t affect DNS resolution on your server.

Really have no idea why my server has this problem.

I didn’t really do anything.

My community was running fine, but all of a sudden this happened to me and I couldn’t connect to my website

Sometimes the local dns server gets broken. Replace that with 8.8.8.8 and see if that fixes it.

Have you rebooted lately? Maybe it’s in adding limbo upgrade state.

I had a similar issue recently, try running the following command, then attempt to rebuild.

sudo apt-get update && sudo apt-get upgrade -y

Another option, if the rebuild fails, would be ./discourse-doctor

I don’t think Discourse-doctor will be any help here. It’s an OS issue.

Doing an update and reboot is a good idea.

That’s a good point, update and reboot worked for a similar issue I had a few days back.