I have a number of machines which do not use a network manager, and only use dhcpcd for setting the IP address. For example, my raspberry pi 4. I have statically assigned the IP address in the /etc/dhcpcd.conf file, and it works, I am happy. What I want to do, is make it so that if I type nslookup machine2 (for example), it appends the configured domain to that lookup.
In another machine that uses dhcpcd (my ArchLinux PC), I have the address configured to use dhcp (i.e. not static this time), via dhcpcd. On my DHCP server, I have set it up so that it specifies the "domain-name" field as an option that is returned to the client. The result, is that my /etc/resolv.conf file is updated with the following line:
domain mydomain.local
As this "domain" value is set in this file, I can simply just type nslookup machine2, and it appends mydomain.local to that query, and my dns server resolves the IP for the fqdn of machine2.mydomain.local.
So ideally, I want to mimick this setup, so that my raspberry pi4 will do the same thing, however it's statically set, so how do I do that?
Please note, I've tried adding "search domain.local" to the /etc/resolv.conf file, and it does what I want it to do, but then these settings are lost on reboot, so I cannot set this value here. I need a proper working solution with dhcpcd.
UPDATES:
I was asked to put an output of my /etc/resolv.conf here:
$ cat /etc/resolv.conf
# Generated by resolvconf
nameserver 10.10.0.1