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

Adding a new local DNS record results in error: dns.hosts[0]: invalid hostname ("") #3238

Open
jelitter opened this issue Feb 21, 2025 · 3 comments

Comments

@jelitter
Copy link

Versions

raspberrypi:/# pihole -v
Core version is v6.0.3 (Latest: v6.0.3)
Web version is v6.0.1 (Latest: v6.0.1)
FTL version is v6.0.1 (Latest: v6.0.1)

Platform

  • OS and version:
  • Platform: Raspberry Pi + Docker

Expected behavior

In Local DNS records, I want to add a new entry "nas" with IP 192.168.0.3,

Actual behavior / bug

This toast error appears: dns.hosts[0]: invalid hostname ("") , and entry is not added.

@yubiuser
Copy link
Member

Please provide a debug token.

@jelitter
Copy link
Author

jelitter commented Feb 26, 2025

@yubiuser
[✓] Your debug token is: https://tricorder.pi-hole.net/m2ckaU2g/

Thanks.

@yubiuser
Copy link
Member

Mhh... strange. You already have some Local DNS records defined, but it still tries to add a new item as if there would be none. See the 0 in dns.hosts[0].

The only suspicious thing in your debug log is the alignment of the hosts in the configuration file /ect/pihole/pihole.toml.
This is your file

     hosts = [
       "192.168.0.5   gdssdf",
       "192.168.0.5   adff",
       "192.168.0.7   addfsd",
       "192.168.0.102 dsfasdf",
       "192.168.0.104 asdfsd",

In my file it looks like

       "10.0.1.8 ssdfs",
       "10.0.1.5 dfsdf",
       "10.0.1.5 adff",
       "10.0.1.201 adsfsdf"

Did you edit the file by hand? Try to remove the additional space of the first entries - there should only be one space between IP and hostname.

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

2 participants