---
name: "cdist-type__hostname"
section: "7"
platform: "linux"
package: "cdist"
version: "7.0.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/cdist-type__hostname"
---

# cdist-type\_\_hostname(7)

Set the hostname

## NAME

cdist-type\_\_hostname - Set the hostname

## DESCRIPTION

Sets the hostname on various operating systems.

**Tip:** For advice on choosing a hostname, see *RFC 1178*.

## REQUIRED PARAMETERS

None.

## OPTIONAL PARAMETERS

- **name**

  The hostname to set. Defaults to the first segment of \_\_target\_host (${\_\_target\_host%%.\*})

## MESSAGES

- **changed**

  Changed the hostname

## EXAMPLES

```
# take hostname from __target_host
__hostname
# set hostname explicitly
__hostname --name some-static-hostname
```

## AUTHORS

Steven Armstrong \<*steven-cdist--@--armstrong.cc*\>

## COPYING

Copyright (C) 2012 Steven Armstrong. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

## COPYRIGHT

ungleich GmbH 2021
