Mailinglist Archive: opensuse (958 mails)

< Previous Next >
Re: [opensuse] Where to set the domain name? - Leap 15.1 beta
On 07/05/2019 11.30, Dr. Werner Fink wrote:
On Tue, May 07, 2019 at 03:56:26AM -0500, Robert T Hardy wrote:
On Monday, May 6, 2019 11:09:44 PM CDT Andrei Borzenkov wrote:
06.05.2019 23:37, Robert T Hardy пишет:
On Monday, May 6, 2019 12:53:13 PM CDT Andrei Borzenkov wrote:
What exactly does not work now? What setting (on actual system, not in
YaST) is missing now? What should have happened if you had Domain input
field?

It's likely package leafnode won't work without a FQDN.

"Domain Name" field in YaST has very little to do with FQDN.

Then where?


OK. It's what I did back in about 13.1 days in order to get leafnode to
work.
And I did it again with a 15.0 fresh install despite problems I don't
remember
with Yast, referenced in this thread. For all my trouble I get the log
messages:

...

My recollection of how it was all supposed to work is pretty vague, and it's
gotten a bit more complex since then. I don't think I ever had a complete
solution, but the idea is to preserve flexibility, so a computer can be part
of a LAN, or part of the internet, or both; can use multiple interfaces, etc.

What should I be doing?


Even if this is mixed up:

NIS (Network Information Service) != DNS (Domain Name System)

The domain name set by domainname(1) (also called ypdomainname or
nisdomainname)
set the NIS/YP doamin name seen in /proc/sys/kernel/domainname. Indeed only
root can do this. Also echo or sysctl can be used to set the domainname.

Ah, you are saying that a call to domainname can set the domain name.

man:
«When called with one argument or with the --file option, the
commands set the host name or the NIS/YP domain name. hostname uses the
sethostname(2) function, while all of the three domainname, ypdomainname
and nisdomainname use setdomainname(2). Note, that this is effective
only until the next reboot. Edit /etc/hostname for permanent change.»

So the file to edit is "/etc/hostname".

Elesar:~ # domainname Elesar
Elesar:~ # domainname
Elesar
Elesar:~ # hostname -f
hostname: Name or service not known
Elesar:~ #

Well, no, that's not quite it.

man

«It is not possible to set the FQDN or the DNS domain name with
the dnsdomainname command (see THE FQDN below).»

Ah.

«The FQDN (Fully Qualified Domain Name) of the system is the name that
the resolver(3) returns for the host name, such as, ursula.example.com.
It is usually the hostname followed by the DNS domain name (the part
after the first dot). You can check the FQDN using hostname --fqdn or
the domain name using dnsdomainname.»

Well, no:

Elesar:~ # hostname --fqdn
hostname: Name or service not known
Elesar:~ #

As it is a dynamic IP, the DNS can not know about the machine.


«The recommended method of setting the FQDN is to make the hostname be
an alias for the fully qualified name using /etc/hosts, DNS, or NIS. For
example, if the hostname was "ursula", one might have a line in
/etc/hosts which reads

127.0.1.1 ursula.example.com ursula
»


Well, as I said, this method collides with postfix. When I did that, I
got this once per minute:

.... fatal: parameter inet_interfaces: no local interface found for
127.0.0.2


«Technically: The FQDN is the name getaddrinfo(3) returns for the host
name returned by gethostname(2). The DNS domain name is the part after
the first dot.

Therefore it depends on the configuration of the resolver
(usually in /etc/host.conf) how you can change it. Usually the hosts
file is parsed before DNS or NIS, so it is most common to change the
FQDN in /etc/hosts.

If a machine has multiple network interfaces/addresses or is used
in a mobile environment, then it may either have multiple FQDNs/domain
names or none at all. Therefore avoid using hostname --fqdn, hostname
--domain and dnsdomainname. hostname --ip-address is subject to the
same limitations so it should be avoided as well.»


Well, as the IP is set by DHCP, I need some script to write the correct
current entry to /etc/hosts. Meanwhile, write it manually on each boot.
But with that alone, "hostnane -f" fails.


The DNS domainname can not set local but only provided by the (remote)
name server providing the database of the DNS. For this /etc/resolv.conf
is used to get the address of the remote name server. You can also run a
local name server daemon (bind or dnsmasq) to provide such a DNS for the
LAN, for this then the /etc/resolv.conf points to 127.0.0.1. To solve
trouble at boot (local or of the host providing the name server) or lost
LAN some common FQDN can be written into /etc/hosts.

The man page says it is set in /etc/hosts :-?


Well, as dnsmasq is running on another computer, how do I tell it to
write an entry for this machine every time DHCP changes the address?


--
Cheers / Saludos,

Carlos E. R.

(from openSUSE, Leap 15.1 x86_64 (ssd-test))

--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
This Thread
Follow Ups