360 Secure SkillHub
360 安全技能中心

Hostname Tool

该 Skill 以命令行方式读取或设置系统主机名:不带参数时输出当前主机名,传入新主机名可修改系统身份(需 root 权限),并提供 --fqdn 与 --ip-address 选项查询完全限定域名和关联 IP。主体为脚本 scripts/hostname.py。

dinghaibin
dinghaibin
热度 30.72
最近更新 2026-05-11 17:46:29
分类:自动化依赖:代码执行应用场景:自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add hostname-tool
Metadata
name
hostname-tool
description
Display or set the system hostname. Use for identifying the current machine on a network and configuring system identity.

Hostname - System Name Utility

Show or modify the system's hostname. The hostname identifies the machine on the network and is used in shell prompts, logs, and network services.

Usage

hostname-tool [options] [new-hostname]

Running without arguments displays the current hostname. Provide a new hostname to change it (requires root privileges).

Examples

# Display current hostname
hostname-tool

# Show fully qualified domain name
hostname-tool --fqdn

# Display IP address associated with hostname
hostname-tool --ip-address