On Wed, Sep 18, 2019 at 7:07 AM Baron <baron@linuxmaniac.net> wrote:

Actually I didn't put it there !
It was automatically generated by "Network Manager" !
I had absolutely no idea until you pointed it out.  Surely that has to
be a bug or at least an error !

My guess would be that your domain is somewhere specified as "lan" and your network manager is inserting that into the search directive. It will be a dynamically generated file. This is how it works, quoting the man page for resolv.conf:

"search Search list for host-name lookup.
              The search list is normally determined from the local domain name; by default, it contains only the local domain name.  This may be changed by listing the desired domain search path following
              the search keyword with spaces or tabs separating the names.  Resolver queries having fewer than ndots dots (default is 1) in them will be attempted using each component of the search path in
              turn  until a match is found.  For environments with multiple subdomains please read options ndots:n below to avoid man-in-the-middle attacks and unnecessary traffic for the root-dns-servers.
              Note that this process may be slow and will generate a lot of network traffic if the servers for the listed domains are not local, and that queries will time out if no server is available for
              one of the domains."

Now, a problem that you're going to have is that your Network Manager may regenerate that file. The /etc/resolv.conf may likely be a symbolic link. What I do on distros that generate that file is remove the symlink, make /etc/resolv.conf a real file, and set it "chattr +i" (immutable attribute) so nothing can modify it. That's off grid and may have consequences if you set up a new connection with a network manager that needs different DNS servers so you'd have to keep that in mind. I use OpenDNS servers anyway, so regardless of any connection that's what I'd want:

nameserver 208.67.222.222
nameserver 208.67.220.220
nameserver 192.168.0.1

With my own router to fall back on, which has, you guessed it, OpenDNS servers configured within it.