question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to set DNS-server and/or hosts file in docker

See original GitHub issue

⚠️ Please verify that this bug has NOT been raised before.

  • I checked and didn’t find similar issue

🛡️ Security Policy

📝 Describe your problem

I am quite new to docker and kuma. I tried to monitor a local https server by name https://sub1.example.com:1234 and it lasts me hours until I realized that kuma never got an ip of that server. The Raspi got its addresses from pihole, which would deliver back a local IP for that host name. But as kuma is in a container, there is a different dns server setting in the container which asks a dns server outside the local net. But as my https-server sub1 is not reachable from the internet, the check fails.

So, is it possible somehow to set the dns server setting inside the docker container (or as new feature in kuma)? And/or is there a way to set a hosts file with static name>ip ?

Meanwhile I set the monitor to https://192.168.1.23:1234 and ckecked ‘ignore TLS/SSL-errors’.

This issue might similar to #1302

🐻 Uptime-Kuma Version

1.17.1

💻 Operating System and Arch

Raspbian Bullseye

🌐 Browser

Firefox latest/stable for Windows 11

🐋 Docker Version

20.10.17, build 100c701

🟩 NodeJS Version

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
nbvcxzcommented, Aug 13, 2022

As far as I understand, you need: https://docs.docker.com/config/containers/container-networking/#dns-services or https://docs.docker.com/engine/reference/commandline/run/#add-entries-to-container-hosts-file---add-host Not Uptime-Kuma specific. You just need to add appropriate parameter to your docker run or compose file.

0reactions
github-actions[bot]commented, Nov 22, 2022

This issue was closed because it has been stalled for 2 days with no activity.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running a DNS Server in Docker - Medium
The first file to configure is the named.conf.options: ... Now it is possible to run the two hosts using the dns-server container as...
Read more >
Configure container DNS - Docker Documentation
No information is available for this page.
Read more >
How to update /etc/hosts file in Docker image during "docker ...
Run an internal DNS; you can set the default DNS server to use in the daemon; that way every container started will automatically...
Read more >
How to configure custom DNS server with Docker?
Docker's /etc/hosts is read-only. I'm trying to use dnsmasq: FROM ubuntu:14.04 # ... RUN apt-get install -y -q dnsmasq RUN echo ...
Read more >
Using the Add-Host Flag for DNS Mapping within Docker ...
The --add-host flag is used to add a single host to IP mapping within a Docker container. This flag can be useful when...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found