Skip to content

Commit

Permalink
Merge pull request #137 from seegno-forks/enhancement/improve-dns-dia…
Browse files Browse the repository at this point in the history
…gnostics

Improve DNS diagnosis instructions
  • Loading branch information
nlf committed Mar 7, 2016
2 parents dd9d811 + 192e4e4 commit e9c7c6f
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions README.md
Expand Up @@ -86,12 +86,20 @@ sudo mkdir -p /etc/resolver
echo "nameserver 172.17.0.1" | sudo tee /etc/resolver/docker
```

Then restart OSX's own DNS server:
Then restart OSX's own DNS server (10.10.4+):

```
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
```

Or when using OSX Yosemite (up until 10.10.4):

```
sudo discoveryutil mdnsflushcache
sudo discoveryutil udnsflushcaches
```

Check if the DNS server is working as expected by querying a running image:

```sh
Expand All @@ -105,11 +113,28 @@ You should see a Docker network IP resolved correctly:
<image>.docker. 0 IN A 172.17.0.2
```

#### Troubleshooting DNS
#### Diagnosing DNS
It usually takes some time to adapt to the DNS naming scheme of `dnsdock`, so if you'd like see which DNS names are being registered in real time, just follow the `dnsdock` logs:

`docker logs --follow dnsdock`

Sometimes the DNS server does not pickup the new resolver immediately. This may require a full `mDNSResponder` restart:

```
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
```

Then check with `scutil --dns` if you have the following entry:

```
resolver #<n>
domain : docker
nameserver[0] : 172.17.0.1
flags : Request A records
Reachable
```

## Troubleshooting
### Unresponsive `docker` cli
If `docker` cli commands hang, there's a good chance that you have a stale entry in your `/etc/hosts` file. Run `dlite stop`, then use sudo to edit your `/etc/hosts` file and remove any entries that end with `# added by dlite` or are surrounded by `# begin dlite` and `# end dlite` comments. Save the hosts file and run `dlite start` and try again.
Expand Down

0 comments on commit e9c7c6f

Please sign in to comment.