On Tue 02 Jan 2018 at 08:50:13 (+0100), john doe wrote: > On 1/2/2018 8:16 AM, john doe wrote: > >On 1/2/2018 8:01 AM, Tom Furie wrote: > >>On Tue, Jan 02, 2018 at 07:52:31AM +0100, john doe wrote: > >> > >>>My default route is not 192.168.1.1 and host(1) gives me that > >>>same error. > >> > >>What the error actually means is that there is no reverse DNS resolution > >>for that IP address, in other words the IP address cannot be resolved to > >>its hostname. It has nothing at all to do with routing. > >> > > > >The OP has said that he want it to get the hostname of his > >upstream router/gateway. > >'ip -r r' will show the FQDN of his default route (192.168.1.1) in > >that case. > > > > Rereading the all conversation I should have said to "David Wright > <deb...@lionunicorn.co.uk>" that the error: > > $ host 192.168.1.1 > Host 1.1.168.192.in-addr.arpa. not found: 3(NXDOMAIN) > > Meens that there is no hostname associated with that ip. > But in the case of the OP it should work.
I haven't a clue what works for the OP, not even after glancing at the subsequent thread that seems to continue the debate. I don't even know exactly how they generated the lines: |> # route |> gateway = home.telecomitalia.it |> # ip route |> gateway = 192.168.1.1 All I did was to suggest how the OP could get ip to do what route appears to do by default, which is to print names in place of dotted quads. I have a name associated with 192.168.1.1 but it's not resolvable through DNS: there's no resolver in the router. I have to resolve it with getent, and I asume my system is doing just that: $ getent hosts 192.168.1.1 192.168.1.1 router $ ping router PING router (192.168.1.1) 56(84) bytes of data. 64 bytes from router (192.168.1.1): icmp_seq=1 ttl=64 time=2.24 ms 64 bytes from router (192.168.1.1): icmp_seq=2 ttl=64 time=1.53 ms 64 bytes from router (192.168.1.1): icmp_seq=3 ttl=64 time=1.15 ms 64 bytes from router (192.168.1.1): icmp_seq=4 ttl=64 time=1.42 ms ^C --- router ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3004ms rtt min/avg/max/mdev = 1.157/1.590/2.245/0.402 ms $ head -12 /etc/hosts # /root/hosts-0-acer 127.0.0.1 localhost 127.0.1.1 acer # # /root/hosts-1-local-template # List of local hosts. # Comment out the line of this host when installing. # Check the IPv6 lines occasionally because they change them. 192.168.1.1 router $ Cheers, David.