Just installed Leap 15.1. Has the ability to specify the domain name been removed from YaST?

Hi folks. I went through the installation process for Leap 15.1 and noticed that the box to specify the domain name was missing. I had a bit of a look around other menus just in case I’d misremembered this particular part of the installation process, but I couldn’t find it anywhere. I gave up on trying to have all of of the man network settings configured by the time of the first boot, and decided to just set the domain name after installation was complete. When I logged in for the first time, I jumped straight in to YaST to set the domain name, but just like in the installation process, there was only a hostname field spanning the entire length of the screen, when I’d normally expect to see a domain name field next to it on the right. Is this supposed to be this way? I decided to stop trying to get the rest of the box configured just in case I’d somehow managed to foul something up in the installation process. I changed very little during the installation process; all I did was add the CLI tools pattern for installation in case it had something useful in it, and then told the installer not to write bootcode to the MBR. I prefer to just boot from a root partition or not have a bootloader at all, but when I told it not to write to the MBR, the installer warned that the system might not be able to boot, so I changed it back, and now whenever the system boots, I always have to keep whacking the F8 key, so I can bring up a disk selection menu where I can choose which HDD to boot from. If I don’t bring up that menu and allow the system to boot as it is configured, then it just sits there on a blank screen with a blinking cursor until I switch it off. All I want to do is let the host know which domain it belongs to, so that any software I install and use will find the correct domain name information? I get the impression the behind the scenes part of the networking settings have been undergoing some gradual change in the past few versions of openSUSE, so how should I go about making sure that I can set the domain name, without having to worry about if I’ve missed updating any relevant configuration files?

There have been changes to Yast network settings. Yes, the place to enter domainname has disappeared. But I think that was mainly used for the DNS domain search string. And there is still a place to enter domain search.

I have not tried, but you can probably include the domain with hostname, if you set that with Yast.

Note that “domainname” has long been confusing. It is supposed to be for NIS/YP, and need not be the same as used in the hostname.

It is no longer possible to enter a “.” in the hostname. There is an explanation of the FQDN (fully qualified domain name rationale in “man 5 hostname” with a suggestion to use an /etc/hosts entry for the FQDN.

Yes, correct, because, the Domain Name is by definition, supplied by the DHCP Server on your LAN.

  • If the machine attaches to another Network, it’ll be supplied with the Domain Name of that network via DHCP – along with the IP address …
  • Whether or not the machine’s name will be changed or, not, is a Network Management decision …

Correct, for the reason given above.

In other words, you’re attempting to work around the policies of the Network Segment you’re attaching to …

In the “Network SettingsHostname/DNS” tab, add the “Network unavailable” Domain Name to the “Domain Search” list – this will add a “127.0.0.2” entry to ‘/etc/hosts’ with the FQDN of your machine.

Correct. This is now the default behaviour.

Yes, this is the current default.

Have you defined a default sequence of disks to boot from in the machine’s UEFI/BIOS?

The CLI commands to check a machine’s current Host Name and Domain Name and FQDN are:


 > hostname
 > dnsdomainname
 > domainname --domain
 > hostname --fqdn
 > domainname --fqdn
 > domainname --all-fqdns

The relevant configuration files are located in ‘/etc/sysconfig/network/’ – pay particular attention to “config” and “dhcp” – these files contain the parameters needed by “netconfig” at boot time.

  • The “ifcfg-*” files are normally setup correctly by YaST but, for a few special cases you may have to manually add parameters to them.

@dcurtisfra, I did a quick scan through the post above, Am I correect that this is all in the case of usimng DHCP?
And does that mean that the Domain name field is available when not using DHCP?

I ask, because I can not do an easy test. I am not using Wicked (nor Network Manager) and thus YaST > System > Network Settings protests at first and then even bails out.

That’s how it is working here. But some people are not using DHCP.

Henk,
if you mean YaST then, yes – AFAICS, YaST assumes that DHCP is being used.

Looking at the Startup Guide and the Reference Guide, for the case of YaST then, the Domain Name field will possibly only appear for the case of “not using DHCP”.

[HR][/HR]I’ll setup a FQHN by means of “hostnamectl” and see what happens after a reboot – I’ll be back soon …

I do not think YaST assumes this. It maybe checked by default, but it is just something that can be used or not. And when not, you configure IP addess, Netmask, etc. yourself. And that includes the Tab Hostname/DNSname, that I always used earlier. But when I now go there YaST bails out because I do not use Wicked, so I can not confirm what I remember I always did.

Setting the static hostname to a FQHN didn’t change to situation with the Header of the main YaST window – it remained as being only the Host Name …
[HR][/HR]Henk, BTW, AFAICS, the option to not use DHCP is only valid for the case of an installation and a parameter setting while booting the Installation Environment.
[HR][/HR]What now?

  • For systems which don’t use DHCP, simply recommend setup manually by means of “hostnamectl”, etc?

I have always (many openSUSE versions) been able to configure using YaST > System > Network settings to

  • use ifconfig, later Wicked
  • switch off “Use DHCP”
  • setting Ip address, Network Mask, Default router, Hostname, Domain name, DNS servers and search domain.

I have done this either direct during installation, or later after installation (when setting it during installation was blocked by not having the Manual Installation feature any more). Also changing e.g. IP address and or hostname later in the life of systems. Never had any problems. I do not use DHCP normaly (I was pressed ti use it from intsllation until short after by the missing Manual feature until I found out about pulling the network cable during the installation).

I now switched to sytemd-network, which is easy to configure and way faster at boot. Only drawback is that I can not help with the YaST > System Network Settings module anymore, because it does not run here anymore.

I did a quick default install to verify and yes… I see no option to modify network settings…
But I wonder (actually suspect) that is because the current Install prompts the User whether to use online repositories, and typically when the User agrees then DHCP is used to set up networking.

I haven’t tried,
But if DHCP was not available then I would expect that the User be prompted to enter network settings which could include setting a hostname.
But haven’t tested this.

As for any hostname with a period in it, I don’t know that has ever been legal.
A period has always been a delimiter between hostnames, domains and sub-domains so inserting a period would be confusing and likely cause hierarchical naming issues. There are additional restrictions on what types of symbols are legal, too.
When you make an entry is /etc/hosts, you can create entries from simple hostnames to FQDN, I’ve never seen the file do any kind of input validation, you can even create invalid names and still resolve using /etc/hosts.

But, remember that
$HOSTNAME is not the same as anything in /etrc/hosts.
The first is your system’s actual hostname variable and the latter is simply a way to resolve names in a hostname based resolution system… there’s a difference.

TSU

I have just modified this Leap-15.1 laptop’s system network settings with YaST.

If static ip is chosen the hostname on that page allows a FQDN. This is used in /etc/hosts
.
On the Hostname/DNS settings page it is not allowed to use a FQDN – no “.” allowed. This is used for /etc/hostname.

There is nowhere in the YaST system network settings to set only a domain name except in the list of preferred dns searches.

Hi guys. Yeah I have DHCP disabled with the IP address/mask manually configured. Sorry about leaving that information out. At the moment, it’s the only device in my subnet that’s actually supposed to consider itself to be a host under that domain name: everything else is either a router/switch or an ordinary computer/laptop.

The output from the suggested commands for getting name-related information are as follows:

hostname yields “www”
all but the last commands yield “Name or service not known”
and domainname --all-fqdns yeilds “mail.[my-domain-name]”.

In the past, I’ve always just relied on Yast to update all relevant configuration files, but I get the impression I can’t do that any more and I’m just going to have to get used to doing it through standard CLI configuration commands or modifying configuration files. Which files do I need to modify or which commands should I use, to make sure that all software like ssh, Apache, and so on get and use the correct information when I install and run them. Like I’m worried that I could end up with a bit of software not working as I expect it to because it doesn’t know which domain it belongs to, and me not being able to figure out why it isn’t behaving as expected.

If I just use honsnamectl, will that handle everything and make changes that’ll persist accross reboots?

Am not checking now,
But in the past YaST has always supported periods when setting the Domain name (which is also the workgroup name when appropriate)… I’ve never tried to insert a period in the Hostname because it just violates rules.

TSU

The system hostname we have been discussing is really the internal, private name of the computer. If you are running servers (mail, web, file, etc.) then the server configuration files will specify how they present themselves to clients. So your machine could be www.domain1, www.domain2, mail.domain2, mail.domain3, ntp.domain1, etc. simultaneously. These names will be shown in http, smtp, etc. responses and handshakes.

The clients will use their own name resolver configuration (hosts file or authorative domain name server) to identify the IP address for the host and domain name they require. My sercers all have administration hostnames, but respond to multiple different domain requests.

Just remark about using the forums. It is best when you post these things not as casual talking, but copy.paste from the terminal (complete, that is inclusing the line with the prompt and command and the line with the new prompt) between CODE tags in your post. It is the # button in the tool bar of the post editor.
An example is here: Using CODE tags Around your paste.

There are likely many possible solutions, here is one that might not be difficult…

Create a special DHCP scope,
Create a “reserved lease” for your new machine (requires knowing the MAC address of your new machine)
Configure the DHCP scope with your preferred DHCP options like specifying hostnames and domain names… etc.

Other solutions I’d consider complicated are creating an AutYaST install file, an alternative to YaST if you had to make similar changes to numerous machines is to simply create an “after Install” script that resets whatever you want (or does anything else).

TSU

Tinkering with a new install…
Here’s something new…
If DHCP does not specify a hostname or domain name,
Then although the hostname will still be autogenerated by the install,
Now the domain name isn’t… It’s left blank.
Until recently openSUSE had always autogenerated the domain if it wasn’t specified setting it to… was it “linux” or something like that?

Reasoning:
A unique hostname must be resolvable on a network, especially for workgroups without a DC and machines are discovered and identified by broadcasts…
A domain name isn’t likely essential for most basic functionality (although generally required for name based access to remote resources) so can be left null.

Also,
In the past I was able to use an echo command followed by a re-direction to update a network variable like $HOSTNAME.
Something has changed, it no longer works must use something like hostnamectl now it seems.

TSU

Just a minor comment.

Checking the one Leap 15.1 system, where I upgraded from 15.0 (instead of a clean install), I notice that “/etc/hostname” contains the fully qualified name (“hostname.domainname”). And it has not cause any problems.

Apologies for not formatting the command’s output in code tags, Henk. Ordinarily I would do, but I had no way to copy the output from the server box and paste it into the browser on my computer, so I thought a brief summary would do because there were only two relevant lines of output.

I had a peek in the settings of the subnet’s gateway router, and I couldn’t find any DHCP Scope settings. I found a couple of pages where the options and text boxes more-or-less fit the description, but the UIs on most pages are disabled anyway. My main interest in using YaST to set the domain name was just to hopefully streamline the configuration process reduce the risk of me forgetting to configure something somewhere. I’m setting this box up again for the first time in almost 3 years, and I was hoping to reduce the scope for making silly configuaration mistakes through forgetfulness, but I guess the sensible thing to do would be to just get on with it whilst being careful. It’s been so long since I set everything up that I can’t even remember what it was that made me a bit twitchy about making sure everything was using the correct domain name.