# Cannot access web UI via pi.hole - but IP address works

**URL:** https://discourse.pi-hole.net/t/cannot-access-web-ui-via-pi-hole-but-ip-address-works/34830
**Category:** docker
**Created:** [June 24, 2020, 5:14am UTC](https://discourse.pi-hole.net/t/cannot-access-web-ui-via-pi-hole-but-ip-address-works/34830 "2020-06-24T05:14:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jim-brighter](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/j/bc8723/32.png) [@jim-brighter](https://discourse.pi-hole.net/u/jim-brighter)
#### Post date: [June 24, 2020, 5:14am UTC](https://discourse.pi-hole.net/t/cannot-access-web-ui-via-pi-hole-but-ip-address-works/34830/1 "2020-06-24T05:14:51Z")

</div>

**Expected Behavior**  
Web interface is available at [http://pi.hole/admin](http://pi.hole/admin)

**Actual Behavior**  
Browsers/curl/ping time out on pi.hole/admin, but can reach the web interface via the IP address.

**Debug Token**  
[https://tricorder.pi-hole.net/xryo4iobnb](https://tricorder.pi-hole.net/xryo4iobnb)

**Setup**

- Raspberry Pi 4 Model B - 2GB DDR4 running Raspberry Pi OS May 2020
- Pihole installed via Docker
- ufw running on the host machine, allowing DNS and HTTP requests only from the LAN
- Using Pihole only as DNS server, not for DHCP
- Setting the pihole as my DNS server on a per-client basis, not at the router level

**Debugging So Far**

- The host machine has IP 192.168.1.225
- My computer has this IP as its DNS server
- [http://192.168.1.225/admin](http://192.168.1.225/admin) displays the web ui
- [http://pi.hole/admin](http://pi.hole/admin) times out
- Using `nslookup` from my computer shows pi.hole resolves to the IP of the container, not the host machine

```auto
$ nslookup pi.hole
Server: 192.168.1.225
Address:	192.168.1.225#53

Name:	pi.hole
Address: 172.17.0.2

```

- The IP of the container is not reachable from my computer:

```auto
$ ping 172.17.0.2
PING 172.17.0.2 (172.17.0.2): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
^C
--- 172.17.0.2 ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss

```

**My Docker Command (slightly modified from [docker-pi-hole/docker\_run.sh at c619303a3096075858bcd684cdc2833da02dd2e1 · pi-hole/docker-pi-hole · GitHub](https://github.com/pi-hole/docker-pi-hole/blob/c619303a3096075858bcd684cdc2833da02dd2e1/docker_run.sh))**

```auto
docker run -d \
    --name pihole \
    -p 53:53/tcp -p 53:53/udp \
    -p 67:67/udp \
    -p 80:80 \
    -p 443:443 \
    -v "$(pwd)/etc-pihole/:/etc/pihole/" \
    -v "$(pwd)/etc-dnsmasq.d/:/etc/dnsmasq.d/" \
    --dns=127.0.0.1 --dns=1.1.1.1 \
    --cap-add=NET_ADMIN \
    --restart=unless-stopped \
    --hostname pi.hole \
    -e VIRTUAL_HOST="pi.hole" \
    -e PROXY_LOCATION="pi.hole" \
    -e TZ="America/New_York" \
    -e WEBPASSWORD="notactuallymypassword" \
    -e ServerIP="192.168.1.225" \
    pihole/pihole:latest

```

I'm not sure if there's something missing in my docker configuration or what, but it seems like it's not routing the http traffic to the container. Any help is appreciated!

---

<div class="post-metadata">

### Author: ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)
#### Post date: [June 24, 2020, 7:33am UTC](https://discourse.pi-hole.net/t/cannot-access-web-ui-via-pi-hole-but-ip-address-works/34830/2 "2020-06-24T07:33:28Z")

</div>

> [@jim-brighter](#):
>
> - The host machine has IP 192.168.1.225
> - My computer has this IP as its DNS server
> 
> (...)  
> Name: pi.hole  
> Address: 172.17.0.2
> 
> - The IP of the container is not reachable from my computer:

Seems like you are running your dockered Pi-hole with a (probably default) bridge network configuration that isolates your container into a separate network.

You want to familiarise yourself with [Docker's network modes](https://docs.docker.com/network/). Once you get a better understanding, you should then decide on the network mode that best suites your need.

For a start, you could run your Pi-hole container in host mode, giving up on isolation, and use the same network as the machine that Docker runs on. If you add additional services in other containers later, you may want to review this decision and again switch to another isolating mode.

For configuration hints with regards to your Pi-hole, have a read of Pi-hole's documentation for [Running Pi-hole Docker](https://github.com/pi-hole/docker-pi-hole#running-pi-hole-docker).

---

<div class="post-metadata">

### Author: ![jim-brighter](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/j/bc8723/32.png) [@jim-brighter](https://discourse.pi-hole.net/u/jim-brighter)
#### Post date: [June 24, 2020, 5:43pm UTC](https://discourse.pi-hole.net/t/cannot-access-web-ui-via-pi-hole-but-ip-address-works/34830/3 "2020-06-24T17:43:41Z")

</div>

Running in host networking mode fixed this, I am able to access via pi.hole now. Thanks for the assistance!
