View previous topic :: View next topic |
Author |
Message |
dmpogo Advocate
Joined: 02 Sep 2004 Posts: 3468 Location: Canada
|
Posted: Wed Jun 09, 2021 6:00 am Post subject: Local area network names - how this works ? [SOLVED] |
|
|
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 |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5321 Location: Bavaria
|
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
|
Back to top |
|
|
Goverp Advocate
Joined: 07 Mar 2007 Posts: 2198
|
Posted: Wed Jun 09, 2021 2:40 pm Post subject: |
|
|
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 |
|
|
dmpogo Advocate
Joined: 02 Sep 2004 Posts: 3468 Location: Canada
|
Posted: Wed Jun 09, 2021 6:43 pm Post subject: |
|
|
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 |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54725 Location: 56N 3W
|
Posted: Wed Jun 09, 2021 7:38 pm Post subject: |
|
|
dmpogo,
You need to pass the -h option to dhcpcd. See _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
dmpogo Advocate
Joined: 02 Sep 2004 Posts: 3468 Location: Canada
|
Posted: Wed Jun 09, 2021 8:31 pm Post subject: |
|
|
NeddySeagoon wrote: | dmpogo,
You need to pass the -h option to dhcpcd. See |
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 |
|
|
|