Hi everyone!
I have a raspberry pi 3b working fine with pi-hole and unbound, but, when I try to change the hostame, although I get it (in fact the result of "hostname" is the fqdn I chose), when I "ping" the rasperry pi, the "ping" command return "64 bytes from pi.hole. Where do I have to change something in orden to the raspi to aswer as "raspi3b". Which is the real name it has.
Thank you in advance.
Beneath you'll find the answers to the commands I told about.
user@raspi3b:/etc/dnsmasq.d $ hostname
raspi3b.lar.jym
user@vmmint22:~$ nslookup raspi3b
Server: 127.0.0.53
Address: 127.0.0.53#53
Non-authoritative answer:
Name: raspi3b.lar.jym
Address: 192.168.1.220
Name: raspi3b.lar.jym
user@vmmint22:~$ ping raspi3b
PING raspi3b.lar.jym (192.168.1.220) 56(84) bytes of data.
64 bytes from pi.hole (192.168.1.220): icmp_seq=1 ttl=64 time=0.739 ms
64 bytes from pi.hole (192.168.1.220): icmp_seq=2 ttl=64 time=1.21 ms
64 bytes from pi.hole (192.168.1.220): icmp_seq=3 ttl=64 time=1.03 ms
64 bytes from pi.hole (192.168.1.220): icmp_seq=4 ttl=64 time=1.26 ms
^C
--- raspi3b.lar.jym ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3006ms
rtt min/avg/max/mdev = 0.739/1.059/1.260/0.204 ms
From the pi run hostnamectl and make sure that the static hostname is set to what you want, then check /etc/hosts and make sure that its properly named there as well.
$ man hostname
[..]
THE FQDN
The FQDN (Fully Qualified Domain Name) of the system is the
name that the resolver(3) returns for the host name, such as,
ursula.example.com. It is usually the hostname followed by
the DNS domain name (the part after the first dot). You can
check the FQDN using hostname --fqdn or the domain name using
dnsdomainname.
You cannot change the FQDN with hostname or dnsdomainname.
The recommended method of setting the FQDN is to make the
hostname be an alias for the fully qualified name using
/etc/hosts, DNS, or NIS. For example, if the hostname was
"ursula", one might have a line in /etc/hosts which reads
127.0.1.1 ursula.example.com ursula
Hi Buckking_Horn. I would like to know why if I have everything configured rightly, the answer to the ping is from pi.hole and not from raspi3b which is its real? name.
I just like to know the origin of things in order to be able to help other people afterwards.
By the way, Merry Christmas!!!!
Ok. Thank you for the info. So I will have to wait until v6 to come in order to change that. (I have tried it in current version and it did not work.. lol). Thank you again.
Did you follow the instructions for the HOSTNAMEFQDN option?
Note about HOSTNAMEFQDN: If no local suffix has been defined, FTL appends the local domain .no_fqdn_available. In this case you should either add domain=whatever.com to a custom config file inside /etc/dnsmasq.d/ (to set whatever.com as local domain) or use domain=# which will try to derive the local domain from /etc/resolv.conf (or whatever is set with resolv-file, when multiple search directives exist, the first one is used).