CDIST-TYPE__HOSTS(7)
β¨ cdist-type__hosts(7) β¨
okay bestie, welcome to cdist-type__hosts from the cdist manual β this is the page that teaches you how to boss around your /etc/hosts file π
πΈ NAME πΈ
cdist-type__hosts β manage entries in /etc/hosts π«Ά
π¦ DESCRIPTION π¦
so basically: this type adds or removes entries from your /etc/hosts file. that's it, that's the whole vibe. no cap. π
β¨ OPTIONAL PARAMETERS β¨
yes bestie, they're all optional β but read the fine print because state and ip are lowkey in a situationship π
stateβ ifstateispresent, thenobject_idwill resolve toip. ifstateisabsent, thenobject_idwill no longer resolve via/etc/hosts, if it was previously configured with this type. and listen β entries you inserted manually are unaffected. this type minds its own business. πipβ the IP address that the hostname (=object_id) must resolve to. ifstateispresent, this parameter is mandatory (fr fr, you need it). ifstateisabsent, this parameter is silently ignored β like, it just doesn't get read, no warning, no drama. πaliasβ an alias for the hostname. you can specify this parameter multiple times, once per alias. stack 'em up, queen. π
π EXAMPLES π
here's the tea, served in a code block β
# Now `funny' resolves to 192.168.1.76,
__hosts funny --ip 192.168.1.76
# and `happy' no longer resolve via /etc/hosts if it was
# previously configured via __hosts.
__hosts happy --state absent
__hosts srv1.example.com --ip 192.168.0.42 --alias srv1
see how funny gets a whole IP glow-up, happy gets ghosted, and srv1.example.com gets a cute little srv1 nickname? iconic behaviour, honestly. β
π SEE ALSO π
hosts(5)β go read the source material bestie, iykyk π
π AUTHORS π
these legends wrote this:
- Dmitry Bogatov
<KAction@gnu.org> - Dennis Camera
<dennis.camera--@--ssrq-sds-fds.ch>
π COPYING π
Copyright (C) 2015-2016 Dmitry Bogatov, 2019 Dennis Camera. 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
β οΈ gentle reminder bestie:state absentonly undoes stuff that this type configured. anything you hand-typed into/etc/hostsstays exactly where it is. don't come for me if you forgot you edited it yourself π
and that's the whole page, no notes. this was cdist 7.0.0, dated Jul 31, 2022 β periodt, go configure some hostnames, you got this πβ¨ππ¦πΈ
π¦ where this page comes from
- fedora 43: cdist 7.0.0-16.fc43 Β· GPL-3.0-only
- fedora 44: cdist 7.0.0-18.fc44 Β· GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms