Re: [Dnsmasq-discuss] Is there a way to return an alias in preference to real host name?

2020-08-03 Thread Petr Menšík
Hi Chris,

I think the most proper way is to change hostname of machine to
something sensible. When you do not want random hostname, give it some
name. And let it use them.

Is there reason, why you cannot change name of the device on device
itself? Have you tried to supply hostname on dhcp-record for the printer?

Default names are used in a way to prevent collisions on larger network.
If you have only few devices, give them shorter names.

Cheers,
Petr

On 8/2/20 2:39 PM, Chris Green wrote:
> I have a couple of systems on my home LAN which have long, not very
> useful, names, e.g.:-
> 
> DESKTOP-978VD5M - An MS Windows machine
> MC342-AE529C - An OKI printer
> 
> I have added cname entries as follows in my dnsmasq.conf :-
> 
> cname=ben,DESKTOP-978VD5M
> cname=oki,MC342-AE529C
> 
> So I can refer to them as 'ben' and 'oki'.
> 
> However it would be even better if the names 'ben' and 'oki' were
> returned when I use 'host', 'arp-scan' or similar commands.  Is there
> a way of getting dnsmasq to do this (preferably without losing the
> ability to use the long, unmemorable, names as well)?
> 

-- 
Petr Menšík
Software Engineer
Red Hat, http://www.redhat.com/
email: pemen...@redhat.com
PGP: DFCF908DB7C87E8E529925BC4931CA5B6C9FC5CB


___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Is there a way to return an alias in preference to real host name?

2020-08-02 Thread Chris Green
On Sun, Aug 02, 2020 at 07:54:00PM +0200, john doe wrote:
> On 8/2/2020 2:39 PM, Chris Green wrote:
> > I have a couple of systems on my home LAN which have long, not very
> > useful, names, e.g.:-
> > 
> >  DESKTOP-978VD5M - An MS Windows machine
> >  MC342-AE529C - An OKI printer
> > 
> > I have added cname entries as follows in my dnsmasq.conf :-
> > 
> >  cname=ben,DESKTOP-978VD5M
> >  cname=oki,MC342-AE529C
> > 
> > So I can refer to them as 'ben' and 'oki'.
> > 
> > However it would be even better if the names 'ben' and 'oki' were
> > returned when I use 'host', 'arp-scan' or similar commands.  Is there
> > a way of getting dnsmasq to do this (preferably without losing the
> > ability to use the long, unmemorable, names as well)?
> > 
> 
> The Host utility should say that 'oki' is an alias for 'MC342-AE529C'
> then show Ip(s) for the record.
> 
Yes it does:-

chris$ host oki
oki is an alias for MC342-AE529C.
MC342-AE529C has address 192.168.1.50

... but 'the other way round' it doesn't tell me about OKI:-

chris$ host 192.168.1.50
50.1.168.192.in-addr.arpa domain name pointer MC342-AE529C.zbmc.eu.


I really want anything that looks up a name from an numeric IP to
return the alias rather than the long name.  I.e. the alias should be
the 'preferred' name as it were.

For example I want "nmap -sP" to return the 'better' names which it
doesn't at present:-

chris$ nmap -sP 192.168.1.0/24
...
...
...
Nmap scan report for MC342-AE529C.zbmc.eu (192.168.1.50)
Host is up (0.00024s latency).
...
...
...

-- 
Chris Green

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Is there a way to return an alias in preference to real host name?

2020-08-02 Thread john doe

On 8/2/2020 2:39 PM, Chris Green wrote:

I have a couple of systems on my home LAN which have long, not very
useful, names, e.g.:-

 DESKTOP-978VD5M - An MS Windows machine
 MC342-AE529C - An OKI printer

I have added cname entries as follows in my dnsmasq.conf :-

 cname=ben,DESKTOP-978VD5M
 cname=oki,MC342-AE529C

So I can refer to them as 'ben' and 'oki'.

However it would be even better if the names 'ben' and 'oki' were
returned when I use 'host', 'arp-scan' or similar commands.  Is there
a way of getting dnsmasq to do this (preferably without losing the
ability to use the long, unmemorable, names as well)?



The Host utility should say that 'oki' is an alias for 'MC342-AE529C'
then show Ip(s) for the record.

--
John Doe

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


[Dnsmasq-discuss] Is there a way to return an alias in preference to real host name?

2020-08-02 Thread Chris Green
I have a couple of systems on my home LAN which have long, not very
useful, names, e.g.:-

DESKTOP-978VD5M - An MS Windows machine
MC342-AE529C - An OKI printer

I have added cname entries as follows in my dnsmasq.conf :-

cname=ben,DESKTOP-978VD5M
cname=oki,MC342-AE529C

So I can refer to them as 'ben' and 'oki'.

However it would be even better if the names 'ben' and 'oki' were
returned when I use 'host', 'arp-scan' or similar commands.  Is there
a way of getting dnsmasq to do this (preferably without losing the
ability to use the long, unmemorable, names as well)?

-- 
Chris Green

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss