On 10/12/19 7:25 AM, Angelo Moreschini wrote:
/Thank you for your answers which provided me with useful basics on how
Linux establishes DNS./
/However, even reading other documentation, I am still not clear what
mechanisms for which a computer becomes accessible in the LAN through
its name:/
Details at the end.
/There are two important files: etc / hosts, etc / hostname and a system
service <namectl> which are used to manage this problem, but it is not
clear to me how (mechanism) they work, collaborate and interact./
"/etc/hosts" contains a manual mapping of names to IP addresses. It is
only useful in very limited cases. I use it to block a lot of ads by
mapping the ad server names to my localhost. But I've also used it for
accessing remote sites that don't have a real DNS name. "hostname" is
just a little utility to print out what the name the computer has been
assigned. "hostnamectl" is a utility to set (and view) the current and
permanent computer name.
/The DNS is defined and presented to an unsuspecting reader (also in the
Fedora manuals) as a telephone directory which provides the telephone
number of each subscriber to a hypothetical phone company OK./
/It is said that this telephone directory is modeled as a tree structure
at the top of which we find the domains .com, .org, gov, .fr, it, etc.
and works as a centralized server of the network that supplies the
numbers in correspondence of names … //OK, OK…./
/This type of solution applies to large computer networks of course./
This is how the internet works. It's really a distributed directory.
The .org, .fr, etc are managed by a top-level server and below that each
group, company, or person manages their own part. It can also be used
in an internal network no matter what size. I run freeipa which helps
manage users and dns entries on my home network and at a school.
/But since this clarification is not explicitly highlighted it can be
confusing to a reader who reads the manual for the first time //in what
context DNS is applied//...:/
Unless you have a local override, DNS is what is used to resolve a
network name.
/Another is to get the name of a computer in a LAN and other is to
create a DNS server .. and context difference (and the different
solutions) is not highlighted in the manuals ...:/
/It was difficult for me and I am still personally bewildered to
distinguish which two different contexts may be .../
/That is to say ... when to simply use the Linux kernel service and when
it can be useful to create a DNS server implemented via BIND./
You would only setup bind if you want to use a full domain setup on your
local network. Most people have no need of this.
Summary:
In a default setup, host name resolution is, in order of priority:
/etc/hosts/, mdns, and dns.
You probably don't want to maintain a hosts file for all the computers
on your network, especially if you are using DHCP.
DNS is generally way overkill and more work to manage.
The easiest method is to use mdns, otherwise known as Bonjour on Macs
and probably some other names. Use "hostnamectl set-hostname myname" to
set a unique name on each computer. Make sure "avahi-daemon" is running
(should be). Make sure you have "nss-mdns" installed (should be by
default). Then you should be able to do "ping myname" (using whatever
name you set earlier).
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx