Code:
# Set the hostname. |
Quote:
You will have to make a file such as; /etc/sysctl.d/hostname.conf Code:
kernel.hostname = "myhostname" |
That did not work.
This is from rc.M # Set the hostname. if [ -r /etc/HOSTNAME ]; then /bin/hostname $(cat /etc/HOSTNAME) else # fall back on this old default: echo "darkstar.example.net" > /etc/HOSTNAME /bin/hostname $(cat /etc/HOSTNAME) fi copied to rc.sethostname then ran it. bash-5.0# ./rc.sethostname hostname: the specified hostname is invalid I saw that flash by at boot time right after the going multiuser message. I have not idea as /etc/HOSTNAME is valid. |
Aw crap HOSTNAME was invalid netconfig shoved the hostname and the domain as one hostname for some reason must have been too big. There is a bug somewhere probably in netconfig?
It put it in like this hostname.domainame.org |
OK I am not exactly sure how this is supposed to work.
netconfig asks for a hostname then a domainname. It puts hostname.domainname in /ect/HOSTNAME. hostname on the command line returns hostname.domainname domainname returns (none) My problem was caused by the domainname I put in netconfig. It has a problem if you use something like this domainname_name.org apparently the _ is not allowed in a doaminname at least it won't work here. Since I don't know the rules for domain names (if any) I just put in what I liked for the local network. Still I think if netconfig asks for a domainname it should set it correctly, providing of course it's a name that meets whatever rules are in place. Not sure if this is a bug or a feature. OK for what its worth AG Domain Name Rules Summary Use only letters, numbers, or hyphen ("-") Domain names cannot begin or end with a hyphen Domain names cannot have more than 63 characters, not including .AG, .COM.AG, .NET.AG, .ORG.AG, .EDU.AG, .GOV.AG, ETC. Maximum length of a complete (Fully Qualified, FQDN) domain name (including .separators) is 255 characters Minimum length of a domain name is 1 character, not including extensions. However, all 1 character domain names are reserved by the Registry. A name may begin with a digit Two character domain names are allowed Domain names considered offensive may be declined For domains to be active on the Internet, they must have at least one configured and working name server. There is no restriction on the physical location or IP address of these name servers. The rest is not related to the names allowed. This rules out the use of _ in a domainname the cause of my initial problem. I still think domainname should be set ny netconfig but I suppose there may be a reason it's not. |
I disagree with Pat on this one. IMO the domain part does not belong in the nodename/hostname. I just have this.
Code:
$ cat /etc/HOSTNAME Oh, and domainname gives you the NIS/YP domain. not the dns domainname. It's not the same thing. |
@TarFile
Told you it's all about the correct syntax ;) Happy to hear you got it working. On why using "_" in the hostname is not really supported, never tried it TBH, you can get some answers from here: https://stackoverflow.com/questions/...erscore-in-it# |
OK if domainname gives you the NIS/YP domain is that not the one set up by netconfig? Don't you have to register the DNS domainname to use it online?
|
hostname and domain name are two different entities.
|
From GazL's reply
"Oh, and domainname gives you the NIS/YP domain. not the dns domainname. It's not the same thing." |
@TarFile
Sorry, missed GazL's "Oh" post edit, considered you were replying to me. Never mind. |
Quote:
|
Yes that does seem odd. Oh well it does show the correct hostname but does not set the domianname at all. I think I may have seem something about not setting domianname for some reason in one of the setup files somewhere in /etc.
|
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.
|
The yp domainname (or nis, as they call it nowadays), which 'domainname' shows, it set by /etc/rc.d/rc.yp. If you use yp.
|
All times are GMT -5. The time now is 05:01 PM. |