Skip to content

Commit

Permalink
Merge pull request #382 from zexi/automated-cherry-pick-of-#381-upstr…
Browse files Browse the repository at this point in the history
…eam-master

Automated cherry pick of #381: fix: 添加默认 dns_domain 导致解析失败的解决文档
  • Loading branch information
zexi authored Nov 1, 2024
2 parents 7146d13 + 2d354df commit 57b2776
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
51 changes: 51 additions & 0 deletions docs/operations/platform-issues/dns.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
sidebar_position: 1
---

# dns_domain 导致虚拟机域名解析失败

因为历史原因遗留问题,在 v3.11.8 版本之前部署的版本会默认设置虚拟机的 `/etc/resolve.conf` 里面的配置为 `search cloud.onecloud.io`

这样的设置有可能导致虚拟机内部域名解析失败,如果出现此问题,可以通过下面的步骤取消全局 dns_domain 的配置,这样新建的虚拟机 DNS 配置就不会默认添加 `search` 配置。


## 取消默认配置

### 1. 取消 configmap 里面的 dns_domain 配置

```bash
kubectl edit configmap -n onecloud default-region

# 找到 dns_domain: cloud.yunion.io 这行的配置
...
dns_domain: cloud.yunion.io
...
# 删掉这行,直接保存退出
```

### 2. 取消当前 region 服务的配置

```bash
climc service-config-edit region2

default:
...
# 也是删除 dns_domain: cloud.yunion.io 这项
dns_domain: office.yunion.io
...
```


### 3. 重启 region 服务

```bash
kubectl -n onecloud rollout restart deployment default-region
```

然后等待 default-region pod 变成 Running,新建虚拟机查看 `/etc/resolv.conf` 文件,如果里面没有设置 search 则配置生效。


## 对于已有虚拟机的影响

- 如果虚拟机是通过 dhcp 从平台分配的 ip ,则再次重新 dhcp 请求,就会修改 DNS 配置
- 如果虚拟机是静态配置的网络(比如纳管 vmware 虚拟机或者裸金属),则需要手工修改
9 changes: 9 additions & 0 deletions docs/operations/platform-issues/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
sidebar_position: 11.1
---

# 平台常见问题

import IndexDocCardList from '@site/src/components/IndexDocCardList';

<IndexDocCardList />

0 comments on commit 57b2776

Please sign in to comment.