I want to use basic tool available without installing anything to solve an IP into it's FQDN. I know the domain in which I can solve this IP.
The command line or the tool should be available on any minimal debian or rhel based system which exclude :
/usr/bin/host/usr/bin/nslookup/usr/bin/dig
I'm trying with getent but to no end for now.
My resolvctl config looks like this:
nameserver 127.0.0.53 search dom2.lan dom1.lan What I want is to get the FQDN of IP 10.1.1.1 in dom3.lan (not in resolvconf) without any package installed but the one on a Ubuntu server minimal image for example.
getent hosts 10.1.1.1 does not return anything.
host 10.1.1.1 dom3.lan return the hostname I want.
So how can I achieve this without installing bind9-tools just with standard systemctl or basic linux package available in any linux distro that is less than 3 years old.
Edit 1 : The solution I'm looking for need to be available to any user. I consider that python3 is available.
Edit 2: I may be confused or dumb or may mis-explain what I mean. If I do the following nslookup request here's the result:
Without domain appened:
nslookup srv1 ;; Got SERVFAIL reply from 127.0.0.53 Server: 127.0.0.53 Address: 127.0.0.53#53 ** server can't find srv1: SERVFAIL With domain happen
nslookup srv1.dom3.lan Server: 127.0.0.53 Address: 127.0.0.53#53 Non-authoritative answer: Name: srv1.dom3.lan Address: 10.1.1.1 Now I know my local DNS can solve dom3.lan. BUT I don't want to add it in my default search in /etc/resolf.conf because it's not my choice and the choice make sense in our context.
BUT I'd like to be able to do reverse lookup like nslookup 10.1.1.1 and using a different search than the one set in /etc/resolv.conf.
AND at the moment I realize that I don't even manage to do such a request from dig or host or nslookup while if I edit my /etc/resolv.conf without changing any other DNS settings it works.
So my question is : is there a way to set a search for a reverse DNS lookup with any tool and if possible not an installed one.
nslookup set q=A set domain=dom3.lan 10.1.1.1 no result with dig
dig @127.0.0.53 +norecurse +domain=dom3.lan. -x 10.1.1.1 No result either. I'm not even sure this question makes sense but there's definitely strange stuff happening on my system. If changing my /etc/resolv.conf search works I feel like a tool like dig or nslookup should work as well.
getent hostsis going to look in/etc/hosts. Issystemd-resolvedavailable (sometimesresolvectl)?search lan?systemd-resolvedyou can set different DNS servers and search domains for different networks. If you have three names and three IPs, add them to your hosts file.