PowerFlex 4.x: как обновить DNS-серверы

Summary: В этой статье базы знаний описывается изменение (удаление/добавление) серверов DNS в среде 4.x PFMP с узлами MVM, работающими под управлением ОС SLES 15 и более поздних версий.

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

1. На узле MVM выполните следующую команду, чтобы просмотреть текущие серверы DNS.

cat /etc/resolv.conf

delladmin@mvm1:~> cat /etc/resolv.conf
### /etc/resolv.conf is a symlink to /run/netconfig/resolv.conf
### autogenerated by netconfig!
#
# Before you change this file manually, consider to define the
# static DNS configuration using the following variables in the
# /etc/sysconfig/network/config file:
#     NETCONFIG_DNS_STATIC_SEARCHLIST
#     NETCONFIG_DNS_STATIC_SERVERS
#     NETCONFIG_DNS_FORWARDER
# or disable DNS configuration updates via netconfig by setting:
#     NETCONFIG_DNS_POLICY=''
#
# See also the netconfig(8) manual page and other documentation.
#
### Call "netconfig update -f" to force adjusting of /etc/resolv.conf.
search boston.ee.com
nameserver 1.2.3.4  <----

 

2. Чтобы добавить/удалить DNS-серверы на узлах MVM, отредактируйте раздел NETCONFIG_DNS_STATIC_SERVERS файла /etc/sysconfig/network/config.

В приведенном ниже примере добавляется DNS-сервер версии 5.6.7.8. Сохраните файл и выйдите, внеся необходимые изменения.

sudo vi /etc/sysconfig/network/config

delladmin@mvm1:~> sudo vi /etc/sysconfig/network/config
...
## Type:        string
## Default:     ""
#
# List of DNS nameserver IP addresses to use for host-name lookup.
# When the NETCONFIG_DNS_FORWARDER variable is set to "resolver",
# the name servers are written directly to /etc/resolv.conf.
# Otherwise, the nameserver are written into a forwarder specific
# configuration file and the /etc/resolv.conf does not contain any
# nameservers causing the glibc to use the name server on the local
# machine (the forwarder). See also netconfig(8) manual page.
#
NETCONFIG_DNS_STATIC_SERVERS="1.2.3.4 5.6.7.8"  <----

 


3. Выполните следующую команду, чтобы сохранить изменения в /etc/resolv.conf:

sudo netconfig update -f

delladmin@mvm1:~> sudo netconfig update -f

 

4. Убедитесь, что изменения были применены:

delladmin@mvm1:~> cat /etc/resolv.conf
 
### /etc/resolv.conf is a symlink to /run/netconfig/resolv.conf
### autogenerated by netconfig!
#
# Before you change this file manually, consider to define the
# static DNS configuration using the following variables in the
# /etc/sysconfig/network/config file:
#     NETCONFIG_DNS_STATIC_SEARCHLIST
#     NETCONFIG_DNS_STATIC_SERVERS
#     NETCONFIG_DNS_FORWARDER
# or disable DNS configuration updates via netconfig by setting:
#     NETCONFIG_DNS_POLICY=''
#
# See also the netconfig(8) manual page and other documentation.
#
### Call "netconfig update -f" to force adjusting of /etc/resolv.conf.
search boston.ee.com
nameserver 1.2.3.4
nameserver 5.6.7.8     <-----

 

5. Повторите описанные выше действия на всех узлах MVM.

 

6. Удалите модули pod coredns, чтобы распространить изменения на эти модули:

for x in `kubectl get pods -n kube-system| grep -i rke2-coredns-rke2-coredns | awk '{print $1}' | grep -iv auto`; do kubectl delete pods -n kube-system $x; done

 

7. Убедитесь, что изменения DNS теперь отражены в модулях pod coredns (за DNS отвечают два модуля pod coredns):

for x in `kubectl get pods -n kube-system|grep -i rke2-coredns-rke2-coredns|awk '{print $1}'|grep -iv auto`; do echo $x; kubectl exec -it $x -n kube-system -- cat /etc/resolv.conf; echo " "; done
 

rke2-coredns-rke2-coredns-6d6fb45d66-8t962
search boston.ee.com
nameserver 1.2.3.4
nameserver 5.6.7.8     <-----
 
rke2-coredns-rke2-coredns-6d6fb45d66-b5c8f
search boston.ee.com
nameserver 1.2.3.4
nameserver 5.6.7.8     <-----

 

 

Article Properties
Article Number: 000227354
Article Type: How To
Last Modified: 28 Apr 2025
Version:  4
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.