LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-14-2019, 02:57 PM   #31
TarFile
Member
 
Registered: Mar 2003
Posts: 371

Original Poster
Rep: Reputation: 37

Not sure I need Network Information Service.

Well now I know more about domain-name that I did before.
 
Old 03-14-2019, 04:36 PM   #32
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Quote:
Originally Posted by Petri Kaukasoina View Post
Historically it was only the hostname and not the full canonical FQDN. Search for word 'hostname' in current's Changelog to see when it was changed in Slackware.
Yes, the rc script used to do something along the lines of:
hostname $(cut -f1 -d. /etc/HOSTNAME)

It was changed here:
Code:
Sat Mar 24 19:47:01 UTC 2018
a/sysvinit-scripts-2.1-noarch-8.txz:  Rebuilt.
  rc.M: Set default hostname using FQDN. Thanks to Andrzej Telszewski.
I disagreed with the change and commented here on LQ at the time, but as it's easy enough to workaround by simply not putting the FQDN in /etc/HOSTNAME I didn't push the issue when nothing came of it.

From hostname (1)
Code:
 THE FQDN
       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.

       You cannot change the FQDN with hostname or dnsdomainname.

       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

       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.
That clearly says to me that Slackware is doing the wrong thing here.
 
Old 03-14-2019, 04:42 PM   #33
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 2,504

Rep: Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461
Quote:
Originally Posted by GazL View Post
That clearly says to me that Slackware is doing the wrong thing here.
It says to me that the man page has not been updated. Everyone else switched to using "hostname" to store the FQDN long ago. I fought the change in Slackware for a long time, going so far as to write patches to keep using the short no-domain-name hostname. Perhaps I'll search my email to find out what the report was that prompted me to go with the flow on this, but given how much effort was previously put into sticking with the short hostname, I'm going to venture that it was time to make this change.

Anyway, if you really think this is the wrong thing to do, you'll need to point out what it breaks. Then perhaps I'll be motivated to dig up what using the short hostname breaks and we can compare notes.
 
2 members found this post helpful.
Old 03-14-2019, 05:29 PM   #34
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
If this is what everyone else is doing then my apologies. I can only go by what is in the docs. If they lie to me, I can't help that.

POSIX doesn't help as it simply defines it as "a name within a connected network".
The only other thing I can point at would be that HOST_NAME_MAX is 64, but dns names can go much longer, so a fqdn might potentially not fit, but people are unlikely to hit that one anyway as no one likes names that long.

I have nothing concrete to point at that I know of that this breaks. Maybe programmers have just got into the habit of assuming that gethostname(2) may or may not return a fqdn and now allow for both possibilities.
 
1 members found this post helpful.
Old 03-14-2019, 07:06 PM   #35
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Right, I've just been over in my OpenBSD box to cross-reference and over there both gethostname() and uname -n both return the domain part, so it does indeed seem that what Slackware is doing is in line with standard conventions. So egg all over face here! That's the last f***ing time I believe anything written on a linux man-page!

Sorry Pat.
 
3 members found this post helpful.
Old 03-15-2019, 08:01 AM   #36
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750

I am forever amazed how our BDFL steers a clear course. I have no clue how it is done. I put it down to Arthur C Clarke's third law.
 
2 members found this post helpful.
Old 03-20-2019, 10:26 PM   #37
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Well, the entire "hostname" concept assumes that the machine in question either
  1. has a single name in a single network or
  2. has a single name (including domain!) in multiple networks

There are ample use-cases where neither are true, mainly around gateways of some sort.
 
Old 07-12-2023, 11:13 PM   #38
borjonx
LQ Newbie
 
Registered: Jul 2023
Posts: 1

Rep: Reputation: 0
I just ran into this & think I found a bug in the setup process. After installing Slackware & during configuration it let me use an underscore in my hostname, but after reboot it resorted to darkstar. When I manually removed the _ from /etc/HOSTNAME & rebooted it used my hostname, as expected and as it has done since I first started using slackware in 1996.
 
Old 07-13-2023, 12:45 AM   #39
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 959

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Quote:
Originally Posted by borjonx View Post
I just ran into this & think I found a bug in the setup process. After installing Slackware & during configuration it let me use an underscore in my hostname, but after reboot it resorted to darkstar. When I manually removed the _ from /etc/HOSTNAME & rebooted it used my hostname, as expected and as it has done since I first started using slackware in 1996.
It might not be very well documented and the setup script might lack some sanity check. However, a hostname may only consist of:
  • letters a-z
  • digits 0-9
  • hyphen (-)

The hostname may not start with a hyphen. Trying to add other characters to a hostname like @£#$%/_ will give you trouble.

regards Henrik
 
Old 07-13-2023, 01:51 AM   #40
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,360

Rep: Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070
Quote:
Originally Posted by henca View Post
It might not be very well documented and the setup script might lack some sanity check. However, a hostname may only consist of:
  • letters a-z
  • digits 0-9
  • hyphen (-)

The hostname may not start with a hyphen. Trying to add other characters to a hostname like @£#$%/_ will give you trouble.

regards Henrik
Code:
The file should contain a single newline-terminated hostname
       string. Comments (lines starting with a "#") are ignored. The
       hostname should be composed of up to 64 7-bit ASCII lower-case
       alphanumeric characters or hyphens forming a valid DNS domain
       name. It is recommended that this name contains only a single
       label, i.e. without any dots. Invalid characters will be filtered
       out in an attempt to make the name valid, but obviously it is
       recommended to use a valid name and not rely on this filtering.
https://www.man7.org/linux/man-pages...ostname.5.html
 
Old 07-13-2023, 03:17 PM   #41
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 959

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Quote:
Originally Posted by marav View Post
Code:
The file should contain a single newline-terminated hostname
       string. Comments (lines starting with a "#") are ignored. The
       hostname should be composed of up to 64 7-bit ASCII lower-case
       alphanumeric characters or hyphens forming a valid DNS domain
       name. It is recommended that this name contains only a single
       label, i.e. without any dots. Invalid characters will be filtered
       out in an attempt to make the name valid, but obviously it is
       recommended to use a valid name and not rely on this filtering.
https://www.man7.org/linux/man-pages...ostname.5.html
Yes, it is possible to find that information on the web with a search engine like google. However, I haven't found that information in any man-page installed on Slackware 15.0. My currently oldest running version of Slackware is 9.1, also back then that man page was missing from the system.

regards Henrik
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
HOSTNAME = hostname -> HOSTNAME: command not found ? thomas2004ch Linux - Software 2 08-26-2013 08:25 PM
'hostname some_name' does not change the hostname. stf92 Slackware 11 02-21-2013 07:09 PM
Not enough space to use apt-get on default partition, how do i change default? mmcm Linux - Newbie 3 01-05-2013 06:37 PM
getting errors related to hostname -- security problem? ok to change hostname? sneakyimp Linux - Server 2 11-18-2012 05:25 PM
after hostname change, syslogd still output previous hostname to messages file tiger2000 Linux - General 3 07-22-2009 09:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration