# \[solved\] pi.hole resolves to 127.0.0.1

**URL:** <https://discourse.pi-hole.net/t/solved-pi-hole-resolves-to-127-0-0-1/78832>\
**Category:** docker\
**Created:** [April 3, 2025, 10:28pm UTC](https://discourse.pi-hole.net/t/solved-pi-hole-resolves-to-127-0-0-1/78832 "2025-04-03T22:28:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![billy-thegreat](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/billy-thegreat/32/49236_2.png) [@billy-thegreat](https://discourse.pi-hole.net/u/billy-thegreat)\
**Post date:** [April 3, 2025, 10:28pm UTC](https://discourse.pi-hole.net/t/solved-pi-hole-resolves-to-127-0-0-1/78832/1 "2025-04-03T22:28:42Z")

</div>

## Expected Behaviour:

I am using pihole in a docker container created using the compose file found on github:

```auto
services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    # For DHCP it is recommended to remove these ports and instead add: network_mode: "host"
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "123:123/udp"
      - "2380:80/tcp"
      - "2480:443/tcp"
    environment:
      TZ: 'America/New_York'
      FTLCONF_webserver_api_password: 'thisisformetoknowandyoutofindout'
      FTLCONF_dns_listeningMode: 'all'
      FTLCONF_dns_reply_host_IPv4: 192.168.0.13
# FTLCONF_REPLY_ADDR4: 192.168.0.13
    volumes:
      - './etc-pihole:/etc/pihole'
      - './etc-dnsmasq.d:/etc/dnsmasq.d'
    # https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
    cap_add:
      - SYS_TIME
      - SYS_NICE
    restart: unless-stopped # Recommended but not required (DHCP needs NET_ADMIN) 

```

## Actual Behaviour:

pi.hole doesn't work in the browser, and nslookup resolves to 127.0.0.1 on other machines, the host, and docker exec

## Debug Token:

[https://tricorder.pi-hole.net/AfBoeVIb/](https://tricorder.pi-hole.net/AfBoeVIb/)

## Need Help

---

<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:** [April 3, 2025, 10:32pm UTC](https://discourse.pi-hole.net/t/solved-pi-hole-resolves-to-127-0-0-1/78832/2 "2025-04-03T22:32:29Z")

</div>

When running your Pi-hole container in one of Docker's bridge network modes, you should pass your host's network IP address into the container's `environment:` section, e.g. (assuming that IP would be `192.168.0.53`):

```auto
      FTLCONF_dns_reply_host_IPv4: '192.168.0.53'
      FTLCONF_dns_reply_host_force4: true

```

---

<div class="post-metadata">

**Author:** ![billy-thegreat](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/billy-thegreat/32/49236_2.png) [@billy-thegreat](https://discourse.pi-hole.net/u/billy-thegreat)\
**Post date:** [April 11, 2025, 2:03am UTC](https://discourse.pi-hole.net/t/solved-pi-hole-resolves-to-127-0-0-1/78832/5 "2025-04-11T02:03:09Z")

</div>

I didn't have force4 set. Thanks!  
(forgot to change to [solved] and to thank you. Much appreciated!
