**NOTE** January 2022 - Changes to Gstreamer and Pipewire packages from PackmanPlease read the following thread about the current changes
-
About the hosts file
My question: Is it allowable to have an entry in my hosts file that has the hostname and ip address of my computer in it?
Example: My computer's hostname is ASU-X99 and it's ip address is 10.111.10.5
Can that entry be added to the hosts file on this computer without causing problems? Especially if it is below the 127.0.0.1 entry?
The reason for my question is:
I have 5 openSUSE systems, a NAS and 3 printers on my network. I am in the habit of doing updates to all the computers in my network from my computer using ssh to log into each of them, using ssh bart@<hostname>, and using zypper up. I should say that all devices except mobile phones have reserved addresses.
I have been having very inconsistent results using hostnames as often I get a name or service not known response. All seems well if the entries are in the hosts file of the various computers, but I would like to use the same file for all the computers, giving me one central point for management, rather than got to each one if/when I need to make a change.
My router (TP-Link 7602) does not have a DNS server in it.
Bart
-
Re: About the hosts file
 Originally Posted by montana_suse_user
My question: Is it allowable to have an entry in my hosts file that has the hostname and ip address of my computer in it?
Example: My computer's hostname is ASU-X99 and it's ip address is 10.111.10.5
Can that entry be added to the hosts file on this computer without causing problems? Especially if it is below the 127.0.0.1 entry?
The reason for my question is:
I have 5 openSUSE systems, a NAS and 3 printers on my network. I am in the habit of doing updates to all the computers in my network from my computer using ssh to log into each of them, using ssh bart@<hostname>, and using zypper up. I should say that all devices except mobile phones have reserved addresses.
I have been having very inconsistent results using hostnames as often I get a name or service not known response. All seems well if the entries are in the hosts file of the various computers, but I would like to use the same file for all the computers, giving me one central point for management, rather than got to each one if/when I need to make a change.
My router (TP-Link 7602) does not have a DNS server in it.
Bart
Hi
I normally just have localhost tied to 127.0.0.x and hostname against the static ip address..... I just have a localhosts text file and just append to /etc/hosts on machines.
Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below... Thanks!
-
Re: About the hosts file
 Originally Posted by malcolmlewis
Hi
I normally just have localhost tied to 127.0.0.x and hostname against the static ip address..... I just have a localhosts text file and just append to /etc/hosts on machines.
Not completely sure I understand. Do you mean there is an entry:
127.0.0.1 localhost
and another at:
192.168.1.x <your local hostname>
?
Bart
-
Re: About the hosts file
 Originally Posted by montana_suse_user
Not completely sure I understand. Do you mean there is an entry:
127.0.0.1 localhost
and another at:
192.168.1.x <your local hostname>
?
Bart
Refer
openSUSE Leap 15.3; KDE Plasma 5
-
Re: About the hosts file
@montana_suse_user,
I can confirm it doesn't do any harm if a host's own hostname and IP is listed in it's "/etc/hosts". I have a similar setup / approach. I don't use only one file but being lazy I just copy the full list of hosts into the file / the YaST dialog when doing a fresh install. That's my habit since many years and I have never had any issue that I could think of being related to it.
-
Re: About the hosts file
 Originally Posted by montana_suse_user
Not completely sure I understand. Do you mean there is an entry:
127.0.0.1 localhost
and another at:
192.168.1.x <your local hostname>
?
Bart
That is rather normal. And the sequence is of no importance.
Henk van Velden
-
Re: About the hosts file
 Originally Posted by montana_suse_user
Is it allowable to have an entry in my hosts file that has the hostname and ip address of my computer in it?
.
I have been having very inconsistent results using hostnames as often I get a name or service not known response. All seems well if the entries are in the hosts file of the various computers, but I would like to use the same file for all the computers, giving me one central point for management, rather than got to each one if/when I need to make a change.
.
My router (TP-Link 7602) does not have a DNS server in it.
Then, you'll have to setup a DNS server for your LAN – assuming that, it's a small private LAN, a «Raspberry Pi» or, something similar, will be more than sufficient for your needs.
- Trying to maintain consistent ‘/etc/hosts’ files across all hosts in a network is and, always was, a Sisyphus task and, doomed to error …
-
Re: About the hosts file
 Originally Posted by montana_suse_user
My question: Is it allowable to have an entry in my hosts file that has the hostname and ip address of my computer in it?
Example: My computer's hostname is ASU-X99 and it's ip address is 10.111.10.5
Can that entry be added to the hosts file on this computer without causing problems? Especially if it is below the 127.0.0.1 entry?
The reason for my question is:
I have 5 openSUSE systems, a NAS and 3 printers on my network. I am in the habit of doing updates to all the computers in my network from my computer using ssh to log into each of them, using ssh bart@<hostname>, and using zypper up. I should say that all devices except mobile phones have reserved addresses.
I have been having very inconsistent results using hostnames as often I get a name or service not known response. All seems well if the entries are in the hosts file of the various computers, but I would like to use the same file for all the computers, giving me one central point for management, rather than got to each one if/when I need to make a change.
My router (TP-Link 7602) does not have a DNS server in it.
Bart
Does that work: https://www.tp-link.com/de/support/faq/1712/ ?
The local network here consists of several hosts and all of the openSUSE machines have this single identical configuration file:
Code:
erlangen:~ # cat /etc/systemd/network/20-wired.network
[Match]
Name=e*
[Network]
DHCP=yes
Domains=fritz.box
erlangen:~ #
Each of them has a unique static hostname:
Code:
erlangen:~ # hostnamectl
Static hostname: erlangen
Icon name: computer-desktop
Chassis: desktop
Location: home
Machine ID: 94f3af277bac4a8eb57da425c9677379
Boot ID: 799357efba7f4566bd72611875e7810e
Operating System: openSUSE Tumbleweed
CPE OS Name: cpe:/o:opensuse:tumbleweed:20220423
Kernel: Linux 5.17.4-1-default
Architecture: x86-64
Hardware Vendor: Micro-Star International Co., Ltd.
Hardware Model: MS-7C56
erlangen:~ #
The above is all I need to check.
i7-6700K (2016), i5-8250U (2018), AMD Ryzen 5 3400G (2020), 5600X (2022) openSUSE Tumbleweed, KDE Plasma
-
Re: About the hosts file
 Originally Posted by karlmistelberger
How does this relate to the OP's questions in any way?
openSUSE Leap 15.3; KDE Plasma 5
-
Re: About the hosts file
@dcurtisfra
Sisyphus ?

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|