Nslookup failing

Sorry for the confusion! Didn't mean to be confusing ... :-(. I think it started (or went) that way because I was thinking it was an easy other, and others had already seen it also.

What file(s) would help here?

Thanks for all the pointers!!!

Some problems I've noticed.
You are not running dhcp server:

config dhcp 'lan'
        option interface 'lan'
        option ignore '1'

Therefore the leasefile

/tmp/dhcp.leases

will be empty and resolver won't be able to find the names.
Either enable the dhcp and assign static dhcp leases like this:

config host
        option dns '1'
        option name 'test'
        option mac 'AA:DD:90:CC:BB:AA'
        option ip '192.168.1.100'
        option hostid '100'
        option duid '003546877899898980ad6776e4f96e5679f'

(replace the fields to your case, no need for .lan suffix)

OR

add entries in the /etc/hosts file, either directly in console or vi luci at Network-Hostnames (here you can add the .lan suffix). Finally make sure /etc/hosts is not ignored (Network - DHCP and DNS - Resolv and Hosts files tab)

Yes, correct - I don't want this machine to try to resolve names ... rather, forward them up to the main DHCP / DNS server on the network (and append the connection suffix if needed).

Make sense?

Thanks!

No, it doesn't make sense. That's why it's not working. You can't turn off DHCP/DNS forwarder; and at the same time add an entry for wap-study.lan.

This is not what I instructed above. OpenWrt doesn't "append" suffixes. I do know Windows OS does that. This is why I told you to use .lan or whatever domain in use on your network.

I get the feeling I'm not saying / explaining this quite right ... :-(. And that's partially because I do know I have had dnsmasq do this in the past. So let me take a step back ... :-).

I have bridged WAN and LAN, so all DHCP and DNS is served upstream ... but still within my network. I just want DNS requests (e.g. nslookup, on OpenWRT) to be sent to the DNS / DHCP server on my network. Is that not possible? I do seem to have that part (sort of) working ... for a FQDN, including my lan suffix. I only say "sort of" because of the BusyBox / nslookup bug, that it's requesting IPv4 and IPv6 both ... IPv4 working, IPv6 not.

So the step above aside (as it does work from a DNS perspective, and this bug was part of the confusion initially) ... is it not possible to also have dnsmasq add the suffix? I'm sure I did this in the past, I just can't recall how I did it. I thought it was a combination of expand-hosts and strict-order, but not having any luck right now.

Thanks!

Either write /etc/resolv.conf directly with the desired nameservers, or use dnsmasq and add on the interface section in /etc/config/network the following:

config interface 'lan'
        option dns '10.1.1.20 10.1.1.10'

I don't understand why IPv6 doesn't work for you in Busybox nslookup. For me it works fine.

root@xeli:~# nslookup www.cisco.com
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:      www.cisco.com
www.cisco.com   canonical name = www.cisco.com.akadns.net
Name:      www.cisco.com.akadns.net
www.cisco.com.akadns.net        canonical name = wwwds.cisco.com.edgekey.net
Name:      wwwds.cisco.com.edgekey.net
wwwds.cisco.com.edgekey.net     canonical name = wwwds.cisco.com.edgekey.net.globalredir.akadns.net
Name:      wwwds.cisco.com.edgekey.net.globalredir.akadns.net
wwwds.cisco.com.edgekey.net.globalredir.akadns.net      canonical name = e2867.dsca.akamaiedge.net
Name:      e2867.dsca.akamaiedge.net
Address 1: 23.38.86.141
www.cisco.com   canonical name = www.cisco.com.akadns.net
www.cisco.com.akadns.net        canonical name = wwwds.cisco.com.edgekey.net
wwwds.cisco.com.edgekey.net     canonical name = wwwds.cisco.com.edgekey.net.globalredir.akadns.net
wwwds.cisco.com.edgekey.net.globalredir.akadns.net      canonical name = e2867.dsca.akamaiedge.net
Address 2: 2a02:26f0:132:3a0::b33
Address 3: 2a02:26f0:132:387::b33
root@xeli:~# nslookup -v
nslookup: unrecognized option: v
BusyBox v1.28.3 () multi-call binary.

Usage: nslookup [HOST] [SERVER]

Query the nameserver for the IP address of the given HOST
optionally using a specified DNS server

/etc/config/dhcp

config dnsmasq
        option authoritative '1'
        option sequential_ip '1'
        option add_local_domain '1'
        option quietdhcp '1'
        option expandhosts '1'
        option domainneeded '1'
        option filterwin2k '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.auto'
        option localise_queries '1'
        option local '/mrv/'
        option domain 'mrv'
        option rebind_protection '0'
        option nonwildcard '1'
        option localservice '0'
        list notinterface 'pppoe-wan'
        option queryport '5353'

config dhcp 'lan'
        option interface 'lan'
        option ra_management '1'
        option start '66'
        option limit '60'
        option force '1'
        option leasetime '1h'
        list domain 'mrv'
        option ra 'server'
        option dhcpv6 'server'

Replace mrv with your domain.

This part is OK - as above, it does seem that nslookup is being pushed upstream now, just an issue with suffixes.

Yes, it works OK here also for FQDN names from the internet. But not internal LAN ... which should be ignored, as I don't have IPv6 enabled. But no biggie!

I can't really copy the entire file, it will break other settings I have - but I do appreciate it! Are there key / needed lines from this (for suffix append)?

Thanks!

Works fine for my lan too

root@xeli:/etc# nslookup xeli.mrv
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:      xeli.mrv
Address 1: 10.14.149.65
Address 2: 172.17.17.1
Address 3: X:X:X:X::1

It is posted for your reference, no need to paste it all. Check what do I have in mine, whether you have it or not, and what does it do. From a quick look I'd say you need all the lines that contain the mrv, add_local_domain, and expandhosts

Yes, but what happens if you do,
nslookup xeli

Does this work? This is what I'm after => have .mrv added automatically.

Thanks!

For xeli there is nothing, because this is the Openwrt router itself. It doesn't acquire its address via DHCP, but has it static.
If I nslookup another device that gets settings from DHCP it works.

root@xeli:~# nslookup raspi
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:      raspi
Address 1: 10.14.149.119
Address 2: X:X:X:X::119

If you want so much to have an answer for static IPs, you'd need to edit manually etc/hosts or Network-Hostnames in WebGUI.

OK, for rapsi - is the DHCP server the OpenWrt router itself, or another machine? That's what I want working, is when it's the other machine -> just need OpenWrt to forward the request (with the suffix appended).

Thanks!

My openwrt router is DHCP server and keeps database for my domain ".mrv"
Raspi and another board are running the Pihole nameserver, but forward to Openwrt when it comes to internal addresses.

OK, thanks! Let me keep fiddling with settings, to figure out how to get the suffix appended.

If you override the config files like @trendy suggests, that may work. But I'm completely lost as to why you're still trying to force OpenWrt to provide a non-qualified domain name and somehow make it "append" a domain.

Now I understand why you're having issues.

Generally, you can append a domain by using the domain option in /etc/resolv.conf , or search for one or more domains using the search option.
The problem is that if you don't use dhcp to automatically create the host entries, or don't fill in the hosts file, you won't get any results.

Just for simplicity - rather than having to type the entire FQDN every time. And really, it's mostly now cuz it's frustrating me, as I know I had this working in the past with dnsmasq.

But the issue is not a big deal, it's only a problem on the router itself. All other machines will be fine, as they bypass dnsmasq.

Thanks!

Yes, understood. Thanks!