Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Local area network names - how this works ? [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3267
Location: Canada

PostPosted: Wed Jun 09, 2021 6:00 am    Post subject: Local area network names - how this works ? [SOLVED] Reply with quote

On my local network my router is a DHCP server, There is no DNS server. I have connected bunch of stuff to the router
What I noticed that most (thought not all) non-Gentoo machines are identified on the router by their names, both two Mac OS X machines I ahve and a bunch of android devices.
On Mac the names the router sees are the same as what 'hostname' gives

However Gentoo machines are listed as 'unknown'. 'hostname' run on each of them gives their assigned names, which are also in /etc/hosts. IP's are obtained via dhcpcd

So, what do Gentoo machines not doing, relative to OS X ones ?

Not that I really need the router know the names, but I 'd like to understand how it all works.


Last edited by dmpogo on Wed Jun 09, 2021 10:15 pm; edited 1 time in total
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4147
Location: Bavaria

PostPosted: Wed Jun 09, 2021 6:44 am    Post subject: Reply with quote

Do you use dhcpcd or dhclient with your gentoo machine ?
Does this help ?
https://www.cyberciti.biz/faq/howto-get-linux-static-dhcp-address/
https://wiki.archlinux.org/title/Dhcpcd
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Wed Jun 09, 2021 12:15 pm    Post subject: Reply with quote

Zeroconf, Bonjour
Back to top
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2004

PostPosted: Wed Jun 09, 2021 2:40 pm    Post subject: Reply with quote

Looking at my machine, where AFAIK my local DHCP server gets its hostname from over the network,
does your /etc/conf.d/hostname need configuring, and is the service started (it's in the boot runlevel on my box).

I've no idea if changing this will help, but it's how mine is configured.
_________________
Greybeard
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3267
Location: Canada

PostPosted: Wed Jun 09, 2021 6:43 pm    Post subject: Reply with quote

Thanks for ideas !

Just having looked into more details of configuration

1) /etc/conf.d/hostname is configured on both Gentoo machines

Code:
 

$  cat /etc/conf.d/hostname
# Set to the hostname of this machine
hostname="polarbear"

$   hostname
polarbear



2) I use dhcpcd

3) I also have avahi running on both Gentoo machines.


Code:


$ avahi-browse _ssh._tcp
+ wlp4s0 IPv4 pardus                                        _ssh._tcp            local
+ wlp4s0 IPv4 grizzly                                       _ssh._tcp            local
+ wlp4s0 IPv4 polarbear                                     _ssh._tcp            local
+ enp0s31f6 IPv4 pardus                                        _ssh._tcp            local
+ enp0s31f6 IPv4 grizzly                                       _ssh._tcp            local
+ enp0s31f6 IPv4 polarbear                                     _ssh._tcp            local
+     lo IPv4 grizzly                                       _ssh._tcp            local


Notice that for ssh service, avahi sees three machines: grizzly and polarbear are hostnames of Gentoo machines, pardus is Mac OS X

and then running ping from grizzly

Code:


$ ping -4 polarbear
ping: polarbear: Name or service not known
$ ping -4 pardus
PING pardus (192.168.1.13) 56(84) bytes of data.
64 bytes from pardus (192.168.1.13): icmp_seq=1 ttl=64 time=2135 ms
64 bytes from pardus (192.168.1.13): icmp_seq=2 ttl=64 time=1101 ms



So Mac machine (pardus) is recognized by its name, Gentoo machine (polarbear) is not. Mac is my wife's machine, there was now custom configuration. Neither pardus nor polarbear are in /etc/hosts on grizzly.


It does seem it is something in dhcpcd client that does not transmit the hostname to DHCP server ?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54232
Location: 56N 3W

PostPosted: Wed Jun 09, 2021 7:38 pm    Post subject: Reply with quote

dmpogo,

You need to pass the -h option to dhcpcd. See
Code:
man dhcpcd

_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3267
Location: Canada

PostPosted: Wed Jun 09, 2021 8:31 pm    Post subject: Reply with quote

NeddySeagoon wrote:
dmpogo,

You need to pass the -h option to dhcpcd. See
Code:
man dhcpcd


Wow, that seems a remarkable change, at least in default configuration, since I just downgraded dhcpcd-8.1.9-r1 and all works out of box.
More over, while it was a home fun, in a meantime I have realized that my office computer did not get his FQDN from university server, after it spend a month at home and got updated in the meantime.
I already got our IT looking into it, which saw immediately that even PTR record was not created (and that is when I started playing with downgrading dhcpcd) BTW, office computer still uses netifrc, but the dhcpcd as client, as far as I see.

Now I need to find where does '-h' option supposed to go :) - well, in OK /etc/dhcpd.conf 'inform DNS server of our hostname ', is commented out by default in the new versions !
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum