4

So I have my DNS by dnsmasq up and running. I can resolve my internal domain name but I cannot resolve the IP to my domain. What I mean to say is I can use

dig rameez-ubuntu

and it works fine but when I use

dig 192.168.0.104

I get NXDOMAIN. I am not much of an expert in networking so please don't quote me on that. I am just trying my hands on setting my own DNS and DHCP server in this quarantine. Can someone please help me how to I resolve the internal IP address to my domain.

1
  • Quite frankly if you don't need the power of dig you might want to look at nslookup from the package dnsutils (which is also one of those providing the dig command in the first place). I think if you're basically not interested beyond PTR, A/AAA and CNAME lookups, that's what you want. To check the lookup capabilities of your libc (as used by programs using it) you can use getent. The mentioned host utility is part of package bind9-host on 18.04. Apr 21, 2020 at 12:33

1 Answer 1

2

You're missing some of dig options do to a reverse dns request.

As specified in the manpage of dig the -x allows you to use reverse lookups.

This will do the job:

dig -x 192.168.0.104 should display rameez-ubuntu

You can also use host 192.168.0.104 to get the same result.

May are you missing some configuration of DNSMasq.
As specified in the manpage of dnsmasq option
--auth-zone=<domain>[,<subnet>[/<prefix length>] allows to :

Define a DNS zone for which dnsmasq acts as authoritative server. Locally defined DNS records which are in the domain will be served. If subnet(s) are given, A and AAAA records must be in one of the specified subnets.

As alternative to directly specifying the subnets, it's possible to give the name of an interface, in which case the subnets implied by that interface's configured addresses and netmask/prefix-length are used; this is useful when using constructed DHCP ranges as the actual address is dynamic and not known when configuring dnsmasq. The interface addresses may be confined to only IPv6 addresses using /6 or to only IPv4 using /4. This is useful when an interface has dynamically determined global IPv6 addresses which should appear in the zone, but RFC1918 IPv4 addresses which should not. Interface-name and address-literal subnet specifications may be used freely in the same --auth-zone declaration.

It's possible to exclude certain IP addresses from responses. It can be used, to make sure that answers contain only global routeable IP addresses (by excluding loopback, RFC1918 and ULA addresses).

The subnet(s) are also used to define in-addr.arpa and ip6.arpa domains which are served for reverse-DNS queries. If not specified, the prefix length defaults to 24 for IPv4 and 64 for IPv6. For IPv4 subnets, the prefix length should be have the value 8, 16 or 24 unless you are familiar with RFC 2317 and have arranged the in-addr.arpa delegation accordingly. Note that if no subnets are specified, then no reverse queries are answered.

2
  • I tried both of the commands but both of them returned NXDOMAIN. do I need to configure something first for reverse lookup in dnsmasq? Apr 21, 2020 at 13:00
  • I have edited my answer to add more informations that can help you
    – Fractalyse
    Apr 21, 2020 at 13:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .