[内容] /etc/resolv.conf 配置文件的 search 选项

内容一:测试 search 选项的配置

# cat /etc/resolv.conf
search eternalcenter.com local new
nameserver 8.8.8.8

内容二:测试 search 选项

2.1 查询 zhumingyu

# host -a zhumingyu
Trying "zhumingyu.eternalcenter.com"
Trying "zhumingyu.local"
Trying "zhumingyu.new"
Trying "zhumingyu"
Host zhumingyu not found: 3(NXDOMAIN)
Received 102 bytes from 8.8.8.8#53 in 62 ms

(补充:当查询 zhumingyu 时,也就是中间没有点 “.”,则默认会被视为查询主机名,会先依次把 eternalcenter.com、local 和 new 作为后缀添加到 zhumingyu 后进行查询,最后才查询 zhumingyu)

2.2 zhumingyu.com

# host -a zhumingyu.com
Trying "zhumingyu.com"
Received 31 bytes from 1.1.1.1#53 in 217 ms
Trying "zhumingyu.com.eternalcenter.com"
Trying "zhumingyu.com.local"
Trying "zhumingyu.com.new"
Host zhumingyu.com.new not found: 4(NOTIMP)
Received 35 bytes from 1.1.1.1#53 in 218 ms

(补充:当查询 zhumingyu.com 时,也就是中间有 1 个点 “.”,则默认会被视为查询域名,会先查询 mingyuzhu.com,如果查询失败,则会先依次把 eternalcenter.com、local 和 new 作为后缀添加到 zhumingyu 后进行查询)

2.3 查询 zhumingyu.com.

# host -a zhumingyu.com.
Trying "zhumingyu.com"
Host zhumingyu.com not found: 4(NOTIMP)
Received 31 bytes from 1.1.1.1#53 in 204 ms
Received 31 bytes from 1.1.1.1#53 in 204 ms

(补充:当查询 zhumingyu.com. 时,也就是末尾有 1 个点 “.”,默认会被视为查询域名,且只会查询这个域名。不会查询 search 里的每 1 项)

[命令] Linux 命令 dig (从 DNS 服务器获取主机信息)

内容一:dig 命令简介

dig 即 domain information groper,主要功能是从 DNS 服务器获取主机信息

内容二:dig 命令的使用案例

2.1 案例一:显示互联网上所有 DNS 根服务器的信息

# dig

2.2 案例二:直接通过域名获取主机信息

# dig eternalcenter.com

(补充:这里以通过 eternalcenter.com 域名获取主机信息为例)

2.3 案例三:直接通过域名获取主机信息,但只显示最基础的内容

# dig eternalcenter.com +short

(补充:这里以通过 eternalcenter.com 域名获取主机信息为例)

2.4 案例四:直接通过域名获取主机信息,并指定显示的内容

# dig eternalcenter.com +noall +answer

(补充:这里以通过 eternalcenter.com 域名获取主机信息,并显示 noall 和 answer 部分的内容为例)

2.5 案例五:从指定的 DNS 服务器和端口号通过域名获取主机信息

# dig @8.8.8.8 -p 53 eternalcenter.com

(补充:这里以通过 eternalcenter.com 域名从 IP 地址是 8.8.8.8 端口是 53 的 DNS 服务器获取主机信息为例)

2.6 案例六:通过 IP 地址获取主机信息

# dig -x 8.8.8.8

(补充:这里以通过 IP 地址 8.8.8.8 获取主机信息为例)

2.7 案例七:通过 IP 地址获得主机信息,但只显示最基础的内容

# dig -x 8.8.8.8  +short

(补充:这里以通过 IP 地址 8.8.8.8 获取主机信息为例)

2.8 案例八:直接通过域名获取主机信息,同时显示获取的过程

# dig eternalcenter.com +trace

(补充:这里以通过 eternalcenter.com 域名获取主机信息为例)

[排错] 解决 Red Hat Satellite 发布新版本 Content Views 时报错 “Unable to find content with the ID “……””

报错代码

Unable to find content with the ID "......"

分析

当 Content Views 里包含有问题的软件源时,发布新版本 Content View 时就会报此类错误

解决方法

步骤一:根据报错时出现的 ID 显示出问题的软件名称

# su - postgres -c "psql candlepin -c \"select uuid, content_id, contentUrl, label, type, vendor from cp2_content where content_id = '9210'\""

(补充:这里以显示 ID 9210 的软件名称为例)

步骤二:给服务器系统打一个快照

(步骤略)

步骤三:强制停止出问题的任务

Monitor –> Tasks –> Paused –> “select the task which publish a new Content View version” –> Cancel

(注意:操作前需要确保左上角的组织是否正确)

或者:

步骤三:将出问题的软件源从要布新版本的 Content Views 里删除

Content –> Content Views –> “select the Content View which whill publish a new version” –> Yum Content –> Repository –> “select the repository which is error” –> Remove Repositories

步骤四:重新发布新版本的 Content Views

(步骤略)

[内容] SUSE Repository Mirroring Tool (RMT) 服务端的设置 (软件源)

内容一:显示软件源

1.1 显示所有的 SUSE 软件源产品

# rmt-cli products list --all

1.2 显示所有已经启用的 SUSE 软件源产品

# rmt-cli products list

1.3 显示所有指定版本且指定架构的 SUSE 软件源产品

# rmt-cli products list --all --version=15.4 --arch=x86_64

(补充:这里以显示所有 15.4 版本且 x86_64 架构的 SUSE 软件源产品为例)

1.4 显示所有已启用指定版本且指定架构的 SUSE 软件源产品

# rmt-cli products list --version=15.4 --arch=x86_64

(补充:这里以显示所有已其应用 15.4 版本且 x86_64 架构的 SUSE 软件源产品为例)

内容二:启用软件源

2.1 启用某个软件源

# rmt-cli products enable <id>

或者:

# rmt-cli products enable <string>

2.2 开启所有指定版本且指定架构的 SUSE 软件源产品

# for i in `rmt-cli products list --all --version=15.4 --arch=x86_64 | awk '{print $2}' | egrep -v '\||ID|^$'`;do rmt-cli products enable $i;done

(补充:这里以开启所有 15.4 版本且 x86_64 架构的 SUSE 软件源产品)

内容三:取消启用软件源

3.1 取消启用某个软件源

# rmt-cli products disable <id>

或者:

# rmt-cli products disable <string>

3.2 取消所有指定版本且指定架构的 SUSE 软件源产品

# for i in `rmt-cli products list --all --version=15.4 --arch=x86_64 | awk '{print $2}' | egrep -v '\||ID|^$'`;do rmt-cli products disable $i;done

(补充:这里以取消开启所有 15.4 版本且 x86_64 架构的 SUSE 软件源产品)

参考文献:

https://documentation.suse.com/sles/15-SP4/single-html/SLES-rmt/index.html#sec-rmt-tools-rmt-cli