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

Add support for custom DNS resolutions #19

Open
dlm31 opened this issue Dec 20, 2024 · 4 comments
Open

Add support for custom DNS resolutions #19

dlm31 opened this issue Dec 20, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@dlm31
Copy link

dlm31 commented Dec 20, 2024

Having issues resolving dns names. I've declard a host named "tapo or tapo.lan", but when I try to resolve either tapo or tapo.lan I get unresolved. Trying this configuration with the original dnsmasq works, but not with this addon.

enable: true
port: 53
dns_domain: lan
upstream_servers:
  - 9.9.9.9
hosts:
  - host: tapo
    ip: 192.168.0.65
  - host: tapo.lan
    ip: 192.168.0.65
@f18m
Copy link
Owner

f18m commented Dec 20, 2024

hey @dlm31 ,
which dnsmasq-dhcp version are you using? Is it 2.0.1 or a 1.xxx version?

can you confirm that you've trying to resolve the "tapo.lan" FQDN from a machine having its DNS server set to the IP address of the HomeAssistant instance hosting the dnsmasq-dhcp addon ? Typically you can run resolvectl status to verify if that's the case.

Moreover the config snippet that you provided... it does not look like a valid dnsmasq-dhcp config syntax:

  • the "hosts" key does not exists
  • the "dhcp_ip_address_reservations" key (the most similar one to your "hosts") should contain a YAML list with keys "mac", "name", "ip" and "link".

In other words a valid dnsmasq-dhcp config for your case would look like:

dns_server:
  enable: true
  port: 53
  dns_domain: lan
  upstream_servers:
    - 9.9.9.9
dhcp_ip_address_reservations:
  - name: tapo
    ip: 192.168.0.65
    mac: <your Tapo MAC address>

@f18m
Copy link
Owner

f18m commented Jan 16, 2025

hey @dlm31 ,
any update you can share w.r.t. the questions in my prev comment?

@dlm31
Copy link
Author

dlm31 commented Jan 17, 2025

Hi,

Not exactly. All those local devices i specify under the dhcp_ip_address_reservations key, do resolve properly, when I try yo resolve their ip from anaother pc on the nerwork.

What still does not work is if I try to define oher name resolutions, or override public ones.
Example, I want the dns server to return 5.5.5.5 when asked for www.google.com.
So under the dns server settings section, some kind of key should exist to be able to define it.

Regards,

@f18m f18m self-assigned this Feb 11, 2025
@f18m f18m added the enhancement New feature or request label Feb 11, 2025
@f18m f18m changed the title Dns hosts not resolving Add suppor for custom DNS resolutions Feb 11, 2025
@f18m f18m changed the title Add suppor for custom DNS resolutions Add support for custom DNS resolutions Feb 11, 2025
@f18m
Copy link
Owner

f18m commented Feb 11, 2025

Hi,

Not exactly. All those local devices i specify under the dhcp_ip_address_reservations key, do resolve properly, when I try yo resolve their ip from anaother pc on the nerwork.

What still does not work is if I try to define oher name resolutions, or override public ones. Example, I want the dns server to return 5.5.5.5 when asked for www.google.com. So under the dns server settings section, some kind of key should exist to be able to define it.

Regards,

Ok thanks, that's more clear now what you're asking for.
Consider that this addon is not currently exposing the full capabilities of dnsmasq... at least not yet.
I flagged this as feature request and I might be able to get there at some point in the future

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

No branches or pull requests

2 participants