Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 添加默认 dns_domain 导致解析失败的解决文档 #381

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 />
Loading