# Could not resolve host: github.com for SamSaffron/pups.git

**URL:** https://meta.discourse.org/t/could-not-resolve-host-github-com-for-samsaffron-pups-git/32050
**Category:** Support
**Tags:** docker
**Created:** [August 13, 2015, 5:04am UTC](https://meta.discourse.org/t/could-not-resolve-host-github-com-for-samsaffron-pups-git/32050 "2015-08-13T05:04:26Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![grumps](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/grumps/32/44817_2.png) [@grumps](https://meta.discourse.org/u/grumps)
#### Post date: [August 13, 2015, 5:04am UTC](https://meta.discourse.org/t/could-not-resolve-host-github-com-for-samsaffron-pups-git/32050/1 "2015-08-13T05:04:26Z")

</div>

Hi all -

We’re enjoying discourse thus far. I’m having an issue with running a rebuild of the docker container. The container won’t rebuild because for some reason it can’t resolve [github.com](http://github.com). I know the host system (debian jessie) can resolve at that time via `dig` && `ping`. However if I issue a `systemctl restart docker` the issue goes away.

I turned to the _goog_ or _alphabet_ machine which suggested starting the docker daemon using the _goog’s_ dns which I’ve done and confirmed that it seems to have taken via a `systemctl status docker`.

I’ve been able to reproduce on a debian droplet and a virtual box vm.

Also I’ve been able to successfully pull a Ubuntu image, and run the container.

I’m not sure if there’s something in `launcher` or any other suggestions? Working off of git master, and is up to date.

shortlist:

- Debian Jessie Kernel 3.16
- Docker version 1.6.2, build 7c8fca2

### launch rebuild app

```bash
root@alpha:/var/discourse# ./launcher rebuild app
Ensuring discourse docker is up to date
Fetching origin
Discourse Docker is up-to-date
Stopping old container
+ /usr/bin/docker stop -t 10 app
app
cd /pups && git pull && /pups/bin/pups --stdin
fatal: unable to access 'https://github.com/SamSaffron/pups.git/': Could not resolve host: github.com
210c421dbe03e0339d110f1eec9eb3c985b0a0d4e32709d569c9cd1f235a7964
**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one

```

### systemctl status - shows --dns

```bash
root@alpha:/var/discourse# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled)
   Active: active (running) since Thu 2015-08-13 03:42:17 UTC; 26min ago
     Docs: http://docs.docker.com
 Main PID: 22232 (docker)
   CGroup: /system.slice/docker.service
           └─22232 /usr/bin/docker -d -H fd:// --dns 8.8.8.8 --dns 8.8.4.4

Aug 13 04:03:40 alpha docker[22232]: time="2015-08-13T04:03:40Z" level=info msg="+job wait(7d602b0addff82e7626b659c5e30131a11ab7f35034198983a19e2b8861111b5)"
Aug 13 04:03:40 alpha docker[22232]: time="2015-08-13T04:03:40Z" level=info msg="-job wait(7d602b0addff82e7626b659c5e30131a11ab7f35034198983a19e2b88... = OK (0)"
Aug 13 04:03:40 alpha docker[22232]: time="2015-08-13T04:03:40Z" level=info msg="DELETE /v1.18/containers/7d602b0addff82e7626b659c5e30131a11ab7f3503...8861111b5"
Aug 13 04:03:40 alpha docker[22232]: time="2015-08-13T04:03:40Z" level=info msg="+job rm(7d602b0addff82e7626b659c5e30131a11ab7f35034198983a19e2b8861111b5)"
Aug 13 04:03:40 alpha docker[22232]: time="2015-08-13T04:03:40Z" level=info msg="+job log(destroy, 7d602b0addff82e7626b659c5e30131a11ab7f35034198983...e:1.0.12)"
Aug 13 04:03:40 alpha docker[22232]: time="2015-08-13T04:03:40Z" level=info msg="-job log(destroy, 7d602b0addff82e7626b659c5e30131a11ab7f35034198983... = OK (0)"
Aug 13 04:03:40 alpha docker[22232]: time="2015-08-13T04:03:40Z" level=info msg="-job rm(7d602b0addff82e7626b659c5e30131a11ab7f35034198983a19e2b8861... = OK (0)"
Aug 13 04:04:15 alpha docker[22232]: time="2015-08-13T04:04:15Z" level=info msg="GET /v1.18/containers/json"
Aug 13 04:04:15 alpha docker[22232]: time="2015-08-13T04:04:15Z" level=info msg="+job containers()"
Aug 13 04:04:15 alpha docker[22232]: time="2015-08-13T04:04:15Z" level=info msg="-job containers() = OK (0)"
Hint: Some lines were ellipsized, use -l to show in full.

```

### docker info

```bash
root@alpha:/var/discourse# docker info
Containers: 3
Images: 18
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 24
 Dirperm1 Supported: true
Execution Driver: native-0.2
Kernel Version: 3.16.0-4-amd64
Operating System: Debian GNU/Linux 8 (jessie)
CPUs: 1
Total Memory: 2.879 GiB
Name: alpha
ID: WF4H:KABY:JPTX:RW2U:FWCT:PNKZ:DR2P:2ZFE:ZLUD:AB4R:D3CH:EXCA
WARNING: No memory limit support
WARNING: No swap limit support

```

edit: formatting fix code block

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [August 13, 2015, 7:14am UTC](https://meta.discourse.org/t/could-not-resolve-host-github-com-for-samsaffron-pups-git/32050/2 "2015-08-13T07:14:48Z")

</div>

This is very likely the solution

> [@Failed to Bootstrap Ping is working to github](https://meta.discourse.org/t/failed-to-bootstrap-ping-is-working-to-github/23869/6):
>
> Edit /etc/default/docker and uncomment the following line: DOCKER\_OPTS="--dns 8.8.8.8 --dns 8.8.4.4" After this, restart docker and rebuild. I had the same issue today. The solution is taken from [https://meta.discourse.org/t/afatal-unable-to-access-https-github-com-samsaffron-pups-git-could-not-resolve-host-github-com/18611/7?u=stefan](https://meta.discourse.org/t/afatal-unable-to-access-https-github-com-samsaffron-pups-git-could-not-resolve-host-github-com/18611/7)

---

<div class="post-metadata">

### Author: ![grumps](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/grumps/32/44817_2.png) [@grumps](https://meta.discourse.org/u/grumps)
#### Post date: [August 13, 2015, 4:35pm UTC](https://meta.discourse.org/t/could-not-resolve-host-github-com-for-samsaffron-pups-git/32050/3 "2015-08-13T16:35:12Z")

</div>

Hi @sam thanks for taking the time to review.  
I have that option uncommented in `/etc/defaults/docker`, and I’ve restarted the docker service many times.

To clarify, after restarting the docker service the `laucher rebuild` will work once, after that I have to restart the service.

You can see this via my systemd status.

```plaintext
CGroup: /system.slice/docker.service
           └─22232 /usr/bin/docker -d -H fd:// --dns 8.8.8.8 --dns 8.8.4.4

```

---

<div class="post-metadata">

### Author: ![imaBASKET](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/imabasket/32/72987_2.png) [@imaBASKET](https://meta.discourse.org/u/imaBASKET)
#### Post date: [August 11, 2018, 3:23am UTC](https://meta.discourse.org/t/could-not-resolve-host-github-com-for-samsaffron-pups-git/32050/4 "2018-08-11T03:23:34Z")

</div>

Same issue, I went to add the cloudflare template and when rebuilding it could not resolve [github.com](http://github.com).

I have already tried the solution of using googles DNS servers in dockers configuration file with no success.

doing `ping github.com` works but again, it cant seem to resolve when rebuilding.

Here is the error:

 ![](https://global.discourse-cdn.com/meta/original/3X/0/f/0f4223fc55dca83a577015a1d69d0dd1edaea3d6.png)

Here is me pinging [github.com](http://github.com)  
[Imgur: The magic of the Internet](https://i.imgur.com/oUjgq8p.png)

Interestingly though, when I ping6 [github.com](http://github.com) I of course do not recieve a response because github does not have AAAA records i believe.  
[Imgur: The magic of the Internet](https://i.imgur.com/Qu9OJg9.png)

Any idea how to fix this?

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [August 11, 2018, 4:03am UTC](https://meta.discourse.org/t/could-not-resolve-host-github-com-for-samsaffron-pups-git/32050/5 "2018-08-11T04:03:33Z")

</div>

This isn’t a Discourse problem, it’s a Docker problem. You’ll probably get more knowledgeable help at the Docker support forums (which, helpfully, also run Discourse).

---

<div class="post-metadata">

### Author: ![imaBASKET](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/imabasket/32/72987_2.png) [@imaBASKET](https://meta.discourse.org/u/imaBASKET)
#### Post date: [August 15, 2018, 1:45am UTC](https://meta.discourse.org/t/could-not-resolve-host-github-com-for-samsaffron-pups-git/32050/6 "2018-08-15T01:45:18Z")

</div>

I figured out the issue and solution to this problem at least for me.

The issue was that Docker uses 8.8.8.8 and 8.8.4.4 as its DNS and I had an OVH network based firewall blocking ALL IPv4 traffic that did not match port 80, 443, and a few other specific rules. I had to authorize IPv4 traffic for 8.8.8.8 and 8.8.4.4

---

<div class="post-metadata">

### Author: ![gekkonen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gekkonen/32/181786_2.png) [@gekkonen](https://meta.discourse.org/u/gekkonen)
#### Post date: [May 26, 2020, 9:29am UTC](https://meta.discourse.org/t/could-not-resolve-host-github-com-for-samsaffron-pups-git/32050/7 "2020-05-26T09:29:13Z")

</div>

I’m experiencing a similar issue on the latest discourse git. This started happening after performing a system update and/or discourse update via the web UI. Now when I try to rebuild the app, I get:

```plaintext
[root@forum /var/discourse]# ./launcher rebuild app
Ensuring launcher is up to date
Fetching origin
Launcher is up-to-date
Stopping old container
+ /usr/bin/docker stop -t 60 app
app
cd /pups && git pull && /pups/bin/pups --stdin
fatal: unable to access 'https://github.com/discourse/pups.git/': Could not resolve host: github.com
8f082ebcb977f9efafbdbff15ab69e8d06c0a7e2cb99410f85e1f90b03ae733b
**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.

```

I can ping [github.com](http://github.com) and 8.8.8.8, and I’ve tried editing `/etc/default/docker` to toggle the DNS option: `DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"`

Where should I continue investigating this?

This is Ubuntu 18.04 with latest updates applied.

---

<div class="post-metadata">

### Author: ![rcauvin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rcauvin/32/118210_2.png) [@rcauvin](https://meta.discourse.org/u/rcauvin)
#### Post date: [May 28, 2020, 1:14am UTC](https://meta.discourse.org/t/could-not-resolve-host-github-com-for-samsaffron-pups-git/32050/8 "2020-05-28T01:14:22Z")

</div>

I am getting the same error as [gekkonen](https://meta.discourse.org/u/gekkonen) after having attempted to upgrade to the latest Discourse version.

It appears Docker can no longer access the Internet at all from the default bridge network:

```
docker run -it --net=bridge --rm busybox ping -c 1 github.com
ping: bad address 'github.com'

```

If I force it to use the host network, it can access the Internet:

```
docker run -it --net=host --rm busybox ping -c 1 github.com
PING github.com (140.82.112.4): 56 data bytes
64 bytes from 140.82.112.4: seq=0 ttl=53 time=6.902 ms

--- github.com ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 6.902/6.902/6.902 ms

```

I am also running Ubuntu 18.04.4 LTS, having upgraded all packages and installed all security upgrades just prior to following the Discourse upgrade sequence.

---

<div class="post-metadata">

### Author: ![rcauvin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rcauvin/32/118210_2.png) [@rcauvin](https://meta.discourse.org/u/rcauvin)
#### Post date: [May 29, 2020, 9:56pm UTC](https://meta.discourse.org/t/could-not-resolve-host-github-com-for-samsaffron-pups-git/32050/9 "2020-05-29T21:56:06Z")

</div>

@gekkonen I got mine running again. As a workaround, to force the Internet to work from Docker, you can configure the docker0 network to use “promiscuous” mode:

> [root@forum /var/discourse]# ifconfig docker0 promisc

You should then be able to use the launcher to rebuild the app, and the Discourse forum should work fine. The caveat is that you probably will have to issue the command again after each reboot.

Let me know if it works for you.

I still don’t know the root cause of the problem.

---

<div class="post-metadata">

### Author: ![gekkonen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gekkonen/32/181786_2.png) [@gekkonen](https://meta.discourse.org/u/gekkonen)
#### Post date: [June 3, 2020, 5:24am UTC](https://meta.discourse.org/t/could-not-resolve-host-github-com-for-samsaffron-pups-git/32050/10 "2020-06-03T05:24:21Z")

</div>

Yes, that seemed to get past the issue with the DNS for now. Thank you for the suggestion.

---

<div class="post-metadata">

### Author: ![paulraines68](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/paulraines68/32/233905_2.png) [@paulraines68](https://meta.discourse.org/u/paulraines68)
#### Post date: [September 3, 2020, 1:10am UTC](https://meta.discourse.org/t/could-not-resolve-host-github-com-for-samsaffron-pups-git/32050/11 "2020-09-03T01:10:20Z")

</div>

On CentOS8 this error is due to the RHEL7 docker rpms (there are no RHEL8 ones yet) not understanding the new nftables based firewall. One has to setup masquerading by hand for the docker0 interface

[https://serverfault.com/questions/987686/no-network-connectivity-to-from-docker-ce-container-on-centos-8](https://serverfault.com/questions/987686/no-network-connectivity-to-from-docker-ce-container-on-centos-8)

---

<div class="post-metadata">

### Author: ![MarcP](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcp/32/160184_2.png) [@MarcP](https://meta.discourse.org/u/MarcP)
#### Post date: [November 12, 2020, 12:24am UTC](https://meta.discourse.org/t/could-not-resolve-host-github-com-for-samsaffron-pups-git/32050/12 "2020-11-12T00:24:12Z")

</div>

> [@paulraines68](#):
>
> On CentOS8 this error is due to the RHEL7 docker rpms (there are no RHEL8 ones yet) not understanding the new nftables based firewall. One has to setup masquerading by hand for the docker0 interface

I’d like to confirm this solution works. I am on CentOS 8, with Hetzner.

To be specific I ran these commands in order like listed below. ([source](https://serverfault.com/questions/987686/no-network-connectivity-to-from-docker-ce-container-on-centos-8)) - thanks to @paulraines68

```plaintext
# Masquerading allows for docker ingress and egress (this is the juicy bit)
firewall-cmd --zone=public --add-masquerade --permanent

# Specifically allow incoming traffic on port 80/443 (nothing new here)
firewall-cmd --zone=public --add-port=80/tcp
firewall-cmd --zone=public --add-port=443/tcp

# Reload firewall to apply permanent rules
firewall-cmd --reload

```

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [November 12, 2020, 12:30am UTC](https://meta.discourse.org/t/could-not-resolve-host-github-com-for-samsaffron-pups-git/32050/13 "2020-11-12T00:30:49Z")

</div>


