PowerFlex 4.x Як оновити DNS-сервери
Summary: Ця база знань описує, як змінювати (видаляти/додавати) DNS-сервери в середовищі 4.x PFMP з вузлами MVM під керуванням OS SLES 15 і вище.
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. Видаліть стручки серцевини, щоб поширити зміни на ці стручки:
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 тепер відображаються в капсулах coredns (є два контейнери coredns, які відповідають за DNS):
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 <-----