Stopping .site from being appended to hostname every bootup

.site gets appended to the end of the hostname every system bootup for me (e.g. hostname.site), even though I’ve changed the hostname in both the Network Settings and Hostnames sections of YaST. How can I stop this?

On Thu April 21 2011 06:36 pm, ChrisH 16 wrote:

>
> .site gets appended to the end of the hostname every system bootup for
> me (e.g. hostname.site), even though I’ve changed the hostname in both
> the Network Settings and Hostnames sections of YaST. How can I stop
> this?
>
ChrisH 16;
In YaST>Network Devices>Network Settings, what do you have set in the
Hostname/DNS tab under “Domain Name”?


P. V.
“We’re all in this together, I’m pulling for you.” Red Green

The default domain name is “site”. So you need to set the domain name in yast (the same place where you set the hostname).

I think that does it if you are using “ifup” to configure your network. If you are using networkmanager, then you may need to make other changes.

Just “site”. I can’t blank it out either. Whenever I change it, whatever I changed it to gets appended every bootup as well.

I’m using networkmanager.

On Thu April 21 2011 09:06 pm, ChrisH 16 wrote:

>
> venzkep;2327657 Wrote:
>> On Thu April 21 2011 06:36 pm, ChrisH 16 wrote:
>>
<snip>
>> ChrisH 16;
>> In YaST>Network Devices>Network Settings, what do you have set in the
>> Hostname/DNS tab under “Domain Name”?
>>
<snip>
>
> Just “site”. I can’t blank it out either. Whenever I change it,
> whatever I changed it to gets appended every bootup as well.
>
> nrickert;2327662 Wrote:
>> The default domain name is “site”. So you need to set the domain name
>> in yast (the same place where you set the hostname).
>>
>> I think that does it if you are using “ifup” to configure your network.
>> If you are using networkmanager, then you may need to make other
>> changes.
>
> I’m using networkmanager.
>
ChrisH 16;

AFAIK it makes not difference whether you use Ifup or Networkmanager, the
Domain name set there is appended to the hostname. Why are you concerned
about the appended domain? Is appending that domain creating any problems on
your network?


P. V.
“We’re all in this together, I’m pulling for you.” Red Green

On 2011-04-22 04:06, ChrisH 16 wrote:
> Just “site”. I can’t blank it out either. Whenever I change it,
> whatever I changed it to gets appended every bootup as well.

Well, that’s how it has to be.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

It is, although judging from the replies I’m going to have tell the network it will just have to deal with it. :stuck_out_tongue:

Using “ifup” that domain was appended. That was fine for me, because I just changed it to a domain name that I found more useful.

But then I found that it was also appending the domain name provided via DHCP (by my router). I could set that to what I wanted to, avoiding the problem. But on my work computer I did not have control over the domain name.

I found out that I could configure dhclient to return a preferred domain name. The comments in “/etc/dhclient.conf” give enough info on how to do that.

I have exactly the same issue. The only issue is that my work machine connects to various licence servers, some of these use the hostname of the machine to grant access. SO by appending the domain to my hostname all the license servers are rejecting me as a result>:(.
A fix\workaround for this would be great as this is something that has changed with updates and was not happening when I first installed 12.3.
Any suggestions??
Can anyone fill us in as why and when this change was implemented??

Especially if you connect to multiple networks,

YAST > Network Devices > Hostname/DNS tab

Make sure the “Change Hostname via DHCP” box is checked.

When this box is checked, DHCP should <replace> the domain name as you appear on the network, it should <not append> anything.
I don’t remember if you can check this locally on your machine but you should be able to verify your machine’s network name in DHCP, any Domain Controllers(if you’re running LDAP), tests from a remote machine, eg ping.

Be sure you configure the Machine Name (the part leftmost in the Fully Qualified Domain Name) properly, that part should be preserved and part of any Hostname on your network.

Note that today, you <must> have a “Fully Qualified Domain Name” which generally means at least one period in the name separating your Machine name and a network name so that DNS and Hosts name resolution (as opposed to NetBIOS name resolution) is configured properly.

TSU

Hi,
I run into the some problem with release 12.3. After system boot the hostname is the FQDN. In the past openSuSE releases the hostname command, $HOST env var, uname -n, etc - all commands give me the machine name only without the domain. We have a lot of scripts depending on the hostname only. So these scripts won’t work in 12.3.

The strange thing is, if I change a network setting via yast2 that causes writing the hostname (i.e. toggle “Assign Hostname to Loopback IP” in Hostname/DNS tab) gives me the old behavior of the above commands until I reboot. I can toggle the setting back and the output of hostname or uname -n is still as expected - the hostname without domain.

vagrant@vagrant-os123:~> uname -a
Linux vagrant-os123.site 3.7.10-1.1-default #1 SMP Thu Feb 28 15:06:29 UTC 2013 (82d3f21) x86_64 x86_64 x86_64 GNU/Linux
vagrant@vagrant-os123:~> sudo /sbin/yast2
vagrant@vagrant-os123:~> uname -a
Linux vagrant-os123 3.7.10-1.1-default #1 SMP Thu Feb 28 15:06:29 UTC 2013 (82d3f21) x86_64 x86_64 x86_64 GNU/Linux

I tried it with a clean installation (textmode; using ifup method, not networkmanager) with 12.3 and 12.2. Release 12.2 works as expected, 12.3 not.

The only workaround I can use is to set /etc/HOSTNAME manually to hostname without domain part. I think that’s not the right way to solve the problem.

Greetz
Thomas

On 2013-05-29 21:16, espe wrote:

> The only workaround I can use is to set /etc/HOSTNAME manually to
> hostname without domain part. I think that’s not the right way to solve
> the problem.

Well, if you think it is a bug, then report it :slight_smile:

(no, you can not report here - we are users like you)

openSUSE:Submitting bug
reports

However, the hostname man page says:

The function gethostname(2) is used to get the hostname.
Only when the hostname -s is called will gethostbyname(3) be
called. The difference in gethostname(2) and gethostby-
name(3) is that gethostbyname(3) is network aware, so it
consults /etc/nsswitch.conf and /etc/host.conf to decide
whether to read information in /etc/sysconfig/network or
/etc/hosts the hostname is also set when the network inter-
face is brought up.

-s, --short
Display the short host name. This is the host
name cut at the first dot.

So you just have to change your scripts :-}


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

IMO you’re forcing a round peg into a square hole, ie making unconventional changes which aren’t recommended only to enable your solution.

IMO the proper solution is to recognize that your non-FQDN name resolution is actually the old, legacy NetBIOS Name resolution.
So, you have 2 possible ways of addressing…

  1. Modify/update your scripts to run using Hostname resolution names.
  2. Implement NetBIOS Name resolution in your network, ie WINS Nameservers and LMhost files (which can be distributed by DHCP if you wish so you don’t have to update every machine by hand)

The point is that there are two types of name resolution systems, and you shouldn’t alter either beyond what it’s designed for. NetBIOS name resolution was originally imagined to provide services only within a LAN, was never envisioned to integrate with the Internet. Host name resolution was always thought to be a “helper” or part of the same name resolution system that is used on the Internet.

That said, you can always use non-FQDN names in your Hosts file, too… For example “localhost” is a common entry that has no groupname extension. So, you’re not far off in saying you can make an entry in the Hosts file without the groupname suffix, but you shouldn’t replace but <add> an additional entry.

HTH,
TSU