Setting hostname and domain in openSUSE

Published on April 13, 2017 by Daniel Lanza

 opensuse

A tutorial to set hostname and domain in openSUSE (server.dalanzg.com):

Requirements

You will need the following:

Steps

Modify hostname file

With root permissions, edit file /etc/hostname.

dalanz@linux-geij:~> sudo vim /etc/hostname

Write the hostname for the server.

srvopensuse

Modify hosts file

Check your network interfaces to find out the IP address for your Ethernet network (eth1).

dalanz@linux-geij:~> sudo ifconfig
eth1      Link encap:Ethernet  HWaddr 08:00:27:91:22:4E
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe91:224e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:234 errors:0 dropped:0 overruns:0 frame:0
          TX packets:266 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:22687 (22.1 Kb)  TX bytes:28332 (27.6 Kb)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:69 errors:0 dropped:0 overruns:0 frame:0
          TX packets:69 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:4630 (4.5 Kb)  TX bytes:4630 (4.5 Kb)

With root permissions, edit file /etc/hosts.

dalanz@linux-geij:~> sudo vim /etc/hosts

Set your IP address for Ethernet network with your FQDN:

Restart rcnetwork services.

dalanz@linux-geij:~> sudo rcnetwork restart

Verification

Check your parameters.

dalanz@linux-geij:~> hostname --short
srvopensuse
dalanz@linux-geij:~> hostname --domain
dalanzg.com
dalanz@linux-geij:~> hostname --fqdn
srvopensuse.dalanzg.com
dalanz@linux-geij:~> hostname --ip-address
10.0.2.15
comments powered by Disqus

See also

Setting SSL or https in Tomcat with openSUSE

A tutorial to configure Tomcat 8 to support SSL or https connection. Requirements You will need the following: An openSUSE virtual machine with VirtualBox (Check this link Java JDK to create Keystores -> Change Java OpenJDK to Oracle JDK Tomcat -> How to install tomcat in openSUSE This tutorial was created with: openSUSE Leap 42.2 Java Version -> jdk1.8.0_121 Tomcat version -> apache-tomcat-8.0.42 Steps Create a keystore using Java JDK Set keystore in Tomcat Check SSL or https connection Create a keystore using Java JDK Keystore file is a container for authorization certificates or public key certificates.

Read more

How to install Tomcat in openSUSE

Requirements You will need the following: Tomcat 8 Optional -> (Change Java OpenJDK to Oracle JDK to run Tomcat. Steps Download Tomcat 8. This case will be Apache Tomcat 8.0.42 -> Core tar.gz (apache-tomcat-8.0.42.tar.gz). Unzip apache-tomcat-8.0.42.tar.gz file and place it in folder /usr/local/tomcat. /usr/local is a folder similar to /usr and remain safe from system software upgrades. dalanz@linux-geij:~> tar -xf apache-tomcat-8.0.42.tar.gz dalanz@linux-geij:~> sudo mkdir -p /usr/local/tomcat dalanz@linux-geij:~> sudo mv apache-tomcat-8.

Read more

Change OpenJDK to Oracle JDK in openSUSE

When installing openSUSE, OpenJDK is installed by default. This tutorial will explain how to change to Oracle JDK. dalanz@linux-geij:~> java -version openjdk version "1.8.0_121" OpenJDK Runtime Environment (IcedTea 3.3.0) (suse-8.1-x86_64) OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode) Requirements You will need the following: Oracle JDK 8 Steps Download Oracle JDK 8. This case will be Linux x64 (jdk-8u121-linux-x64.tar.gz). Unzip jdk-8u121-linux-x64.tar.gz file and change the ownership

Read more