Re: hostname of the modem gateway
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
> <email@example.com>" that the error:
> $ host 192.168.1.1
> Host 184.108.40.206.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
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
$ 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
--- 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
# List of local hosts.
# Comment out the line of this host when installing.
# Check the IPv6 lines occasionally because they change them.