DNSMASQ Not working or config issue?

Hi, I have a Cloudflare tunnel set up to my HA instance. Works just fine. I want to use Dnsmasq addon to resolve my Cloudflare domain to my local HA IP address.

Config:

defaults:

  • 8.8.8.8
  • 8.8.8.4
    forwards: []
    hosts:
  • host: xxxxxx.com
    ip: 192.168.1.15
    services: []
    cnames: []
    log_queries: true

However when I check nslookup xxxxxx.com it does not resolve to my locatl HA IP address.

What am I doing wrong here ?

Many thanks !!!

Hi, I have a similar issue. I installed the DNSMasq AddOn on my HA and wanted to configure it to resolve some hosts in my local network:

  • configured the router to use HA (DNSMasq) as first DNS → 192.168.1.60
  • and the router itself as a secondary DNS → 192.168.1.1

I am tying to ping one of the hosts which I have configured under hosts in DNSMasq but it does not resolve. What can I do? My router’s IP is 192.168.1.1 and the HA (DNSMasq) is on 192.168.1.60.

This is my hosts file:
defaults:

  • 192.168.1.1
    forwards:
    hosts:
  • host: localhost
    ip: 127.0.0.1
  • host: wattpilot
    ip: 192.168.1.103
  • host: inverter
    ip: 192.168.1.108
    services:
    cnames:
    log_queries: false

Any help @agners ?

Many thanks!

My setup:

  • Raspberry 4
  • Home Assistnat OS: 12.0
  • Core: 2024.2.5
  • DNSMASQ AddOn: Version 1.6.0
    → DNS resolution never worked since I installed this addon.

You’re trying to configure something called “recursive DNS” here, but you’re hoping that the DNS client (ie the first nameserver) won’t have information about one of your hosts and that your client will ask the next nameserver. Nope. As soon as a nameserver – any nameserver – responds, then that’s the answer.

dnsmasq can do what you’re looking for but you have to configure your dnsmasq server to push the query up to the next nameserver instead. Use a forward for that.