[步骤] dnsmasq 的搭建 (DNS 服务)

步骤一:安装 dnsmasq

# yum install dnsmasq

步骤二:添加 DNS 配置

# vi /etc/dnsmasq.d/address.conf

创建以下内容:

all-servers
server=1.1.1.1
server=8.8.8.8

server=/cn/114.114.114.114

address=/test-gateway.com/192.168.100.1

host-record=gateway.com,192.168.100.1


补充:
1) 这里的 all-servers 代表同时解析下面所有的 DNS 记录
2) 这里的 server=1.1.1.1 和 server=8.8.8.8 代表上游 DNS 服务器使用 1.1.1.1 和 8.8.8.8
3) 这里的 server=/cn/114.114.114.114 代表以 cn 结尾的域名上游 DNS 使用 114.114.114.114
4) 这里的 address=/test-gateway.com/192.168.100.1 代表所有以 test-gateway.com 结尾的域名 (例如 one.test-gateway.com) 指向 IP 地址 192.168.100.1
5) 这里的 host-record=gateway.com,192.168.100.1 代表 gateway.com 域名指向 IP 地址 192.168.100.1

步骤三:重启 dnsmasq 服务

3.1 重启 dnsmasq 服务

# systemctl restart dnsmasq.service 

3.2 查看 dnsmasq 服务状态

# systemctl status dnsmasq.service
● dnsmasq.service - DNS caching server.
   Loaded: loaded (/usr/lib/systemd/system/dnsmasq.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2025-08-14 00:00:35 CST; 7s ago
 Main PID: 10412 (dnsmasq)
    Tasks: 1 (limit: 5781)
   Memory: 704.0K
   CGroup: /system.slice/dnsmasq.service
           └─10412 /usr/sbin/dnsmasq -k

Aug 14 00:00:35 tool1 dnsmasq[10412]: compile time options: IPv6 GNU-getopt DBus no-i18n IDN2 DHCP>
Aug 14 00:00:35 tool1 dnsmasq[10412]: using nameserver 114.114.114.114#53 for domain cn
Aug 14 00:00:35 tool1 dnsmasq[10412]: using nameserver 8.8.8.8#53
Aug 14 00:00:35 tool1 dnsmasq[10412]: using nameserver 1.1.1.1#53
Aug 14 00:00:35 tool1 dnsmasq[10412]: reading /etc/resolv.conf
Aug 14 00:00:35 tool1 dnsmasq[10412]: using nameserver 114.114.114.114#53 for domain cn
Aug 14 00:00:35 tool1 dnsmasq[10412]: using nameserver 8.8.8.8#53
Aug 14 00:00:35 tool1 dnsmasq[10412]: using nameserver 1.1.1.1#53
Aug 14 00:00:35 tool1 dnsmasq[10412]: ignoring nameserver 192.168.100.11 - local interface
Aug 14 00:00:35 tool1 dnsmasq[10412]: read /etc/hosts - 2 addresses 

步骤四:使用配置好的 dnsmasq 服务

# vi /etc/resolv.conf

将全部内容修改如下:

nameserver 192.168.100.11

(补充:这里的 192.168.100.11 指的是刚刚搭建 dnsmasq 服务的服务器的 IP 地址)

步骤五:测试 dnsmasq 服务

5.1 测试 DNS 正向解析

# nslookup test-gateway.com
Server:		192.168.100.11
Address:	192.168.100.11#53

Name:	test-gateway.com
Address: 192.168.100.1

(补充:这里以正向解析刚刚配置的域名 test-gateway.com 为例)

5.2 测试 DNS 反向解析

# arp 192.168.100.1
Address                  HWtype  HWaddress           Flags Mask            Iface
_gateway                 ether   52:54:00:ef:3a:4d   C                     eth0

(补充:这里以反向解析刚刚配置的 IP 地址 192.168.100.1 为例)

[DEBUG] Red Hat Satellite resolve remove repository error ‘Unable to find content with the ID XXX’

Error Code:

Katello::Errors::CandlepinError: Unable to find content with the ID XXX

Solution One: Add Relevant Licenses

Solution One Step One: Make sure which repository is marked as Orphaned

Access Satellite Web –> Content –> Sync Status –> Find the Orphaned repository

Solution One Step Two: Add Relevant Licenses

(Omit Steps)

Solution Two: Remove Orphaned Repositories

Solution Two Step One: Make sure which repository is marked as Orphaned

Access Satellite Web –> Content –> Sync Status –> Find the Orphaned repository

Solution Two Step Two: Remove Orphaned Repositories

Access Satellite Web –> Content –> Red Hat Repositories –> Remove Orphaned Repositories

Solution Two Step Three: Resume Removing Orphaned Repositories Task Status (If Removing Orphaned Repositories Task is Stuck)

3.1 Access the concerned task

Access Satellite Web –> Monitor –> Tasks –> Search for the concerned task

3.2 Check both the Run and Finalize tabs for the sub-task

Click on the DynFlow Console button and check both the Run and Finalize tabs for the sub-task

3.3 Skip the ERROR sub-task

(Omit Steps)

(Add: usually it’s the Actions::Candlepin::Environment::SetContent one )

3.4 Resume Removing Orphaned Repositories Task Status

(Omit Steps)

Reference:

https://access.redhat.com/solutions/6654081

[步骤] Red Hat Satellite 必须软件包版本的查看

正文:

Red Hat Satellite 通常使用指定版本的软件。所以在安装或升级 Red Hat Satellite 时,我们需要设置 Red Hat Satellite 的模块流,在设置模块流以后,相应的软件就被锁定制在对应版本无法升级了。

我们可以通过查看 Red Hat Satellite 的模块流,确认有哪些软件被锁定在了哪些版本里

步骤一:

# dnf module enable satellite

或者:

# dnf module enable satellite:el8
......
Requires         : pki-core:[]
                 : platform:[el8]
                 : postgresql:[12]
                 : ruby:[2.7]

(补充:这里设置 el8 版本的 Red Hat Satellite 模块流为例)

步骤二:

# dnf module info

或者:

# dnf module info satellite:el8
......
Requires         : pki-core:[]
                 : platform:[el8]
                 : postgresql:[12]
                 : ruby:[2.7]

(补充:这里查看 el8 版本的 Red Hat Satellite 模块流为例)

参考文献:

https://docs.redhat.com/en/documentation/red_hat_satellite/6.15/html/installing_satellite_server_in_a_connected_network_environment/installing_server_connected_satellite#configuring-repositories_satellite

[步骤] SLES 软件库的启用和禁用

注意:

在启用或禁用 SLES 的软件库前,要先注册此 SLES

正文:

步骤一:显示所有可用软件库

# SUSEConnect --list-extensions

步骤二:启用软件库

# SUSEConnect -p sle-module-live-patching/15.3/x86_64

(补充:这里以启用 sle-module-live-patching/15.3/x86_64 软件库为例)

步骤三:禁用软件库

# SUSEConnect -d -p sle-module-basesystem/15.3/x86_64

(补充:这里以禁用用 sle-module-live-patching/15.3/x86_64 软件库为例)

[步骤] RHEL 系统的注册 (注册到 Red Hat 官网)

正文:

步骤一:清除旧有的注册信息

1.1 清除所有的旧有注册信息

# subscription-manager remove --all

1.2 取消注册

# subscription-manager unregister

1.3 清楚所有的就有数据

# subscription-manager clean

1.4 确保所有 satellite 客户端安装包已经删除

# yum remove katello-ca-consumer-*

步骤二:确保 RHEL 系统的注册网站指向 Red Hat 官网

# vim /etc/rhsm/rhsm.conf

确保部分内容如下:

......
hostname = subscription.rhsm.redhat.com
......
baseurl = https://cdn.redhat.com
......

步骤三:注册 RHEL 系统到 Red Hat 官网

3.1 非交互式

# subscription-manager register --username <username> --password <password> --auto-attach

(注意:如果完成了本文的 2.1 就不用再执行 本文的 2.2 了)

3.2 交互式注册 RHEL 系统到 Red Hat 官网

3.2.1 交互式注册 RHEL 系统到 Red Hat 官网
# subscription-manager register
3.2.2 在 Red Hat 官网上将相关订阅 (license) 分配给系统

登录 Red Hat 官网 –> Red Hat Customer Portal –> subscriptions –> systems –> <system name> –> 添加订阅

(注意:如果是使用的 Simple Content Access 模式的话,则无需这一步)

3.2.3 刷新订阅
# subscription-manager refresh
3.2.4 查看注册状态
3.2.4.1 查看订阅的消费情况
# subscription-manager list --consumed
3.2.4.2 查看注册状态
# subscription-manager status

参考文献:

https://access.redhat.com/solutions/253273