50

The man page of unshare says:

UTS namespace

setting hostname, domainname will not affect rest of the system (CLONE_NEWUTS flag)

What does UTS stand for?

xmllmx
  • 1,750
  • 2
  • 19
  • 29

2 Answers2

52

It means the process has a separate copy of the hostname and the (now mostly unused) NIS domain name, so it can set it to something else without affecting the rest of the system.

The hostname is set via sethostname and is the nodename member of the struct returned by uname. The NIS domain name is set by setdomainname and is the domainname member of the struct returned by uname.

UTS stands for UNIX Timesharing System.

References:

Mikel
  • 56,387
  • 13
  • 130
  • 149
  • 2
    Note how the system call is `uname` but the structure it returns is called `utsname`. In that sense, it seems you can pretty much read UTS == UNIX. Presumably it's called a "UTS namespace", since that hints at `uname`, rather than "UNIX namespace", which suggests something that affects the whole system. – Mikel Feb 09 '15 at 04:50
  • 1
    **Time**sharing? Why doesn't it have separate system date and time? It whould be useful for starting a program that only works in a limited range of dates. – Vi. Feb 09 '15 at 10:13
  • 4
    @Vi. That's not what timesharing means. – user253751 Oct 10 '16 at 22:29
  • 10
    @Vi. [_Timesharing_](https://en.wikipedia.org/wiki/Time-sharing) in this context comes from the 1960s/70s when it was a novel feature that multiple people could use one computer at the same time. Unix was one such system. – poolie Dec 16 '16 at 02:15
  • 2
    From those that don't know what "NIS" means: from the [wiki](https://en.wikipedia.org/wiki/Network_Information_Service) - The Network Information Service, or NIS (originally called Yellow Pages or YP) is a client–server directory service protocol for distributing system configuration data such as user and host names between computers on a computer network. – mbigras Mar 31 '17 at 22:49
7

In short, the UTS namespace is about isolating hostnames.

The UTS namespace is used to isolate two specific elements of the system that relate to the uname system call. The UTS(UNIX Time Sharing) namespace is named after the data structure used to store information returned by the uname system call. Specifically, the UTS namespace isolates the hostname and the NIS domain name. NIS, an abbreviation of Network Information Service, is an outdated directory service.

Reference https://windsock.io/uts-namespace/

X. Wang
  • 171
  • 1
  • 3