Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnsmasq not adding additionalHostsEntries #191

Open
MujiSayed opened this issue Oct 8, 2021 · 9 comments
Open

dnsmasq not adding additionalHostsEntries #191

MujiSayed opened this issue Oct 8, 2021 · 9 comments

Comments

@MujiSayed
Copy link

MujiSayed commented Oct 8, 2021

Hello,
Not sure what i'm doing wrong, but pihole deploys successfully, but the following section doesn't seem to work. When i visit pihole, and click on local DNS -> DNS Records, this section is empty

dnsmasq:
  # -- Add upstream dns servers. All lines will be added to the pihole dnsmasq configuration
  upstreamServers: []
  # - server=/foo.bar/192.168.178.10
  # - server=/bar.foo/192.168.178.11

  # -- Add custom dns entries to override the dns resolution. All lines will be added to the pihole dnsmasq configuration.
  customDnsEntries: [
  # - address=/foo.bar/192.168.178.10
  # - address=/bar.foo/192.168.178.11

  ]
  # -- Dnsmasq reads the /etc/hosts file to resolve ips. You can add additional entries if you like
  additionalHostsEntries: [
    10.15.15.200    host1.iad
    10.15.15.201    host2.iad
    10.15.15.202    host3.iad
    10.15.15.210    host4.iad
    10.15.15.211    host5.iad
    10.15.15.15      host6.iad
    10.15.15.15      host7.iad
    10.15.15.15      host8.iad
]

Would appreciate any assistance please.
Thanks,

@simonosterberg
Copy link

Im not able to confirm it right now but i think you want to use the customDnsEntries and not additionalHostEntries for adding hosts to local DNS records.

@MujiSayed
Copy link
Author

tried giving this a shot as well, but am still not seeing anything in the custom list

  customDnsEntries: [
  # - address=/foo.bar/192.168.178.10
  # - address=/bar.foo/192.168.178.11
  address=/host1.iad/10.15.15.200
  ]

also tried this but this resulted in the following error: Error: failed to parse pihole.values.yml: error converting YAML to JSON: yaml: line 264: did not find expected node content

  customDnsEntries: [
  # - address=/foo.bar/192.168.178.10
  # - address=/bar.foo/192.168.178.11
     - address=/host1.iad/10.15.15.200
  ]

@MoJo2600
Copy link
Owner

MoJo2600 commented Nov 23, 2021

My custom dns look like this:

dnsmasq:
  customDnsEntries:
    - address=/share.xxx.de/192.168.178.10
    - address=/grafana.xxx.de/192.168.178.60
    - address=/pihole.xxx.de/192.168.178.252
    - address=/openhab.xxx.de/192.168.178.25
    - address=/odroid.xxx.de/192.168.178.26
    - address=/trac.xxx.de/192.168.178.64
  additionalHostsEntries:
    - 192.168.178.10    nas.foo.bar       nas
    - 192.168.178.60    unifi.foo.bar     unifi
    - 192.168.178.61    home.foo.bar      home

Thing is, it works, even when the entries are not shown in the GUI. I do not have a solution for this, but for me it is okay this way.

@AlexanderLieret
Copy link

AlexanderLieret commented Dec 22, 2021

This is related to #131.

The local DNS records are stored in /etc/pihole/custom.list and the local CNAME records in /etc/dnsmasq.d/05-pihole-custom-cname.conf. The first can be saved by the persistent volume. The second unfortunately not fails to write the changes to the config and does not show a proper error message but shows a green success message.

The values of the section dnsmasq are appended to the dnsmasq configuration. This explains why the custom entries (of @MoJo2600) are working but not showing up in the GUI.

@MoJo2600
Copy link
Owner

I will test the PR and merge it asap.

@Tchoupinax
Copy link

Hello,

According my tries the issue continues to exist, but I'm happy to know that the entries should work even if they are not displayed on the GUI :)

What's up on this issue? The PR is opened?
Thanks!

@arana198
Copy link

arana198 commented Jul 3, 2023

This is related to #131.

The local DNS records are stored in /etc/pihole/custom.list and the local CNAME records in /etc/dnsmasq.d/05-pihole-custom-cname.conf. The first can be saved by the persistent volume. The second unfortunately not fails to write the changes to the config and does not show a proper error message but shows a green success message.

The values of the section dnsmasq are appended to the dnsmasq configuration. This explains why the custom entries (of @MoJo2600) are working but not showing up in the GUI.

Hey @AlexanderLieret did you ever resolve this? I have same problem as you

@perfectra1n
Copy link

This is related to #269.

@xorinzor
Copy link

xorinzor commented Feb 17, 2024

Since these 2 files have a different format, it would be a nice improvement if the yaml could be improved too.
Instead of writing lines like - address=/my.host/192.168.1.1 perhaps this could be changed to:

- host: my.host
  address: 192.168.1.1

Then the formatting can be handled within the template. This would make the values.yaml a bit more readable too.

Similar story for the custom CNAME entries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants