Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #190518 > unrolled thread

hostname of the modem gateway

Started byMax Power <debian@cpnetserver.net>
First post2018-01-02 00:30 +0100
Last post2018-01-02 16:10 +0100
Articles 14 — 6 participants

Back to article view | Back to linux.debian.user


Contents

  hostname of the modem gateway Max Power <debian@cpnetserver.net> - 2018-01-02 00:30 +0100
    Re: hostname of the modem gateway john doe <johndoe65534@mail.com> - 2018-01-02 06:30 +0100
      Re: hostname of the modem gateway David Wright <deblis@lionunicorn.co.uk> - 2018-01-02 07:20 +0100
        Re: hostname of the modem gateway Tom Furie <tom@furie.org.uk> - 2018-01-02 07:50 +0100
          Re: hostname of the modem gateway john doe <johndoe65534@mail.com> - 2018-01-02 08:00 +0100
            Re: hostname of the modem gateway Tom Furie <tom@furie.org.uk> - 2018-01-02 08:10 +0100
              Re: hostname of the modem gateway john doe <johndoe65534@mail.com> - 2018-01-02 08:20 +0100
                Re: hostname of the modem gateway john doe <johndoe65534@mail.com> - 2018-01-02 09:00 +0100
                  Re: hostname of the modem gateway David Wright <deblis@lionunicorn.co.uk> - 2018-01-03 11:10 +0100
        Re: hostname of the modem gateway john doe <johndoe65534@mail.com> - 2018-01-02 07:50 +0100
    Re: hostname of the modem gateway Tom Furie <tom@furie.org.uk> - 2018-01-02 09:30 +0100
    Re: hostname of the modem gateway Greg Wooledge <wooledg@eeg.ccf.org> - 2018-01-02 15:40 +0100
    Re: hostname of the modem gateway Greg Wooledge <wooledg@eeg.ccf.org> - 2018-01-02 16:10 +0100
    Re: hostname of the modem gateway Glenn English <ghe2001@gmail.com> - 2018-01-02 16:10 +0100

#190518 — hostname of the modem gateway

FromMax Power <debian@cpnetserver.net>
Date2018-01-02 00:30 +0100
Subjecthostname of the modem gateway
Message-ID<v3hGO-Ao-7@gated-at.bofh.it>
Hi guys,
with the new release of Debian 'Stretch', the route command has been replaced
but what other command returns the hostname of the modem/router gateway...?
# route
gateway = home.telecomitalia.it
# ip route
gateway = 192.168.1.1

Thanks for reply, Max Power.

[toc] | [next] | [standalone]


#190521

Fromjohn doe <johndoe65534@mail.com>
Date2018-01-02 06:30 +0100
Message-ID<v3njb-4ul-1@gated-at.bofh.it>
In reply to#190518
On 1/2/2018 12:12 AM, Max Power wrote:
> Hi guys,
> with the new release of Debian 'Stretch', the route command has been replaced
> but what other command returns the hostname of the modem/router gateway...?
> # route
> gateway = home.telecomitalia.it
> # ip route
> gateway = 192.168.1.1
> 
> Thanks for reply, Max Power.
> 

You could try the host(1) utility:

$ host 192.168.1.1

https://linux.die.net/man/1/host

-- 
John Doe

[toc] | [prev] | [next] | [standalone]


#190522

FromDavid Wright <deblis@lionunicorn.co.uk>
Date2018-01-02 07:20 +0100
Message-ID<v3o5z-51F-1@gated-at.bofh.it>
In reply to#190521
On Tue 02 Jan 2018 at 06:25:29 (+0100), john doe wrote:
> On 1/2/2018 12:12 AM, Max Power wrote:
> >Hi guys,
> >with the new release of Debian 'Stretch', the route command has been replaced
> >but what other command returns the hostname of the modem/router gateway...?
> ># route
> >gateway = home.telecomitalia.it
> ># ip route
> >gateway = 192.168.1.1

$ ip -r r

You need to ask for the resolver with -r.

man ip-route documents the arguments/commands, but you need
man ip for the options (which are common).

> >
> >Thanks for reply, Max Power.
> >
> 
> You could try the host(1) utility:
> 
> $ host 192.168.1.1
> 
> https://linux.die.net/man/1/host

$ host 192.168.1.1
Host 1.1.168.192.in-addr.arpa. not found: 3(NXDOMAIN)
$ 

Cheers,
David.

[toc] | [prev] | [next] | [standalone]


#190523

FromTom Furie <tom@furie.org.uk>
Date2018-01-02 07:50 +0100
Message-ID<v3oyB-5dr-5@gated-at.bofh.it>
In reply to#190522

[Multipart message — attachments visible in raw view] — view raw

On Tue, Jan 02, 2018 at 07:38:54AM +0100, john doe wrote:

> Looks like 192.168.1.1 is not your default route.

What led you to that conclusion?

Cheers,
Tom

-- 
A good scapegoat is hard to find.
A guilty conscience is the mother of invention.
		-- Carolyn Wells

[toc] | [prev] | [next] | [standalone]


#190525

Fromjohn doe <johndoe65534@mail.com>
Date2018-01-02 08:00 +0100
Message-ID<v3oIh-5gZ-13@gated-at.bofh.it>
In reply to#190523
On 1/2/2018 7:45 AM, Tom Furie wrote:
> On Tue, Jan 02, 2018 at 07:38:54AM +0100, john doe wrote:
> 
>> Looks like 192.168.1.1 is not your default route.
> 
> What led you to that conclusion?
> 

My default route is not 192.168.1.1 and host(1) gives me that same error.

-- 
John Doe

[toc] | [prev] | [next] | [standalone]


#190526

FromTom Furie <tom@furie.org.uk>
Date2018-01-02 08:10 +0100
Message-ID<v3oRX-5Aa-3@gated-at.bofh.it>
In reply to#190525

[Multipart message — attachments visible in raw view] — view raw

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.

Cheers,
Tom

-- 
Man is a rational animal who always loses his temper when he is called upon
to act in accordance with the dictates of reason.
		-- Oscar Wilde

[toc] | [prev] | [next] | [standalone]


#190527

Fromjohn doe <johndoe65534@mail.com>
Date2018-01-02 08:20 +0100
Message-ID<v3p1D-5Fs-3@gated-at.bofh.it>
In reply to#190526
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.

-- 
John Doe

[toc] | [prev] | [next] | [standalone]


#190528

Fromjohn doe <johndoe65534@mail.com>
Date2018-01-02 09:00 +0100
Message-ID<v3pEm-5VA-9@gated-at.bofh.it>
In reply to#190527
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 
<deblis@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.

-- 
John Doe

[toc] | [prev] | [next] | [standalone]


#190593

FromDavid Wright <deblis@lionunicorn.co.uk>
Date2018-01-03 11:10 +0100
Message-ID<v3O9I-5Ka-17@gated-at.bofh.it>
In reply to#190528
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
> <deblis@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.

[toc] | [prev] | [next] | [standalone]


#190524

Fromjohn doe <johndoe65534@mail.com>
Date2018-01-02 07:50 +0100
Message-ID<v3oyB-5dr-7@gated-at.bofh.it>
In reply to#190522
On 1/2/2018 7:15 AM, David Wright wrote:
> On Tue 02 Jan 2018 at 06:25:29 (+0100), john doe wrote:
>> On 1/2/2018 12:12 AM, Max Power wrote:
>>> Hi guys,
>>> with the new release of Debian 'Stretch', the route command has been replaced
>>> but what other command returns the hostname of the modem/router gateway...?
>>> # route
>>> gateway = home.telecomitalia.it
>>> # ip route
>>> gateway = 192.168.1.1
> 
> $ ip -r r
> 
> You need to ask for the resolver with -r.
> 
> man ip-route documents the arguments/commands, but you need
> man ip for the options (which are common).
> 
>>>
>>> Thanks for reply, Max Power.
>>>
>>
>> You could try the host(1) utility:
>>
>> $ host 192.168.1.1
>>
>> https://linux.die.net/man/1/host
> 
> $ host 192.168.1.1
> Host 1.1.168.192.in-addr.arpa. not found: 3(NXDOMAIN)
> $
> 

Looks like 192.168.1.1 is not your default route.

-- 
John Doe

[toc] | [prev] | [next] | [standalone]


#190529

FromTom Furie <tom@furie.org.uk>
Date2018-01-02 09:30 +0100
Message-ID<v3q7o-6ly-5@gated-at.bofh.it>
In reply to#190518

[Multipart message — attachments visible in raw view] — view raw

On Tue, Jan 02, 2018 at 12:12:47AM +0100, Max Power wrote:

> with the new release of Debian 'Stretch', the route command has been replaced
> but what other command returns the hostname of the modem/router gateway...?
> # route
> gateway = home.telecomitalia.it
> # ip route
> gateway = 192.168.1.1

As has already been mentioned, 'ip -r route' (or 'ip -r r', for short)
will work. However if you want to use the 'route' command, or 'netstat
-r' which is equivalent, it is still available in the 'net-tools'
package.

Cheers,
Tom

-- 
Any sufficiently advanced technology is indistinguishable from a rigged demo.
		-- Andy Finkel, computer guy

[toc] | [prev] | [next] | [standalone]


#190543

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2018-01-02 15:40 +0100
Message-ID<v3vTs-1QD-9@gated-at.bofh.it>
In reply to#190518
On Tue, Jan 02, 2018 at 12:12:47AM +0100, Max Power wrote:
> Hi guys,
> with the new release of Debian 'Stretch', the route command has been replaced
> but what other command returns the hostname of the modem/router gateway...?
> # route
> gateway = home.telecomitalia.it
> # ip route
> gateway = 192.168.1.1
> 
> Thanks for reply, Max Power.

http://mywiki.wooledge.org/XyProblem
http://mywiki.wooledge.org/IpAddress

I bet one or both of those will help, in the long run.

Note that the gateway address given by DHCP is available in a variable
that dhclient-enter-hooks scripts can use.  You probably want to get it
that way instead of running "ip route" or "route" or "netstat -r" or
any other command.

[toc] | [prev] | [next] | [standalone]


#190544

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2018-01-02 16:10 +0100
Message-ID<v3wmt-2iI-1@gated-at.bofh.it>
In reply to#190518
On Tue, Jan 02, 2018 at 02:59:41PM +0000, Glenn English wrote:
> On Mon, Jan 1, 2018 at 11:12 PM, Max Power <debian@cpnetserver.net> wrote:
> 
> > with the new release of Debian 'Stretch', the route command has been replaced
> 
> Wipe your disk and install Buster. You get route++ back.

Worst advice ever.

[toc] | [prev] | [next] | [standalone]


#190545

FromGlenn English <ghe2001@gmail.com>
Date2018-01-02 16:10 +0100
Message-ID<v3wmt-2iI-3@gated-at.bofh.it>
In reply to#190518
On Mon, Jan 1, 2018 at 11:12 PM, Max Power <debian@cpnetserver.net> wrote:

> with the new release of Debian 'Stretch', the route command has been replaced

Wipe your disk and install Buster. You get route++ back.

Or create some shell scripts...

--
Glenn English

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web