Linux — namespaces: UTS (Part 2)

Shlomi Boutnaru, Ph.D.
2 min readDec 7, 2022

--

In the first part of the series we have talked generally about what are namespace and what we can do with them — in case you want to go over it you can use the following link https://systemweakness.com/linux-namespaces-part-1-dcee9c40fb68. Now we are going to deep dive to the different namespaces starting with UTS (Unix Time Sharing).

By using UTS namespaces we can separate/isolate/segregate the hostname and the NIS (Network Information Service) domain of a Linux system. Just to clarify, NIS is a directory service (it has some similarities to Microsoft’s Active Directory) that was created by Sun and later was discontinued by Oracle. Thus, UTS today is focused mainly on separating hostname.

In order to get the information described above we can use the following syscalls: uname (“man 2 uname”), gethostname (“man 2 gethostname”) and getdomainname (“man 2 getdomainname”) — we also have a parallel set syscall for each one of them. For supporting UTS namespaces the kernel should be compiled with “CONFIG_UTS_NS”.

Container engines (such as docker) use different namespaces to isolate between different containers, even if they were created from the same image — as shown in the screenshot below. If you want you can also use the

See you in my next writeup ;-)

You can follow me on twitter — @boutnaru (https://twitter.com/boutnaru).

--

--