# rpc 错误：代码 = Unavailable，描述 = 最后的解析器错误：产生了零个地址

- **ID:** `go/grpc-code-unavailable-lb-policy`
- **领域:** go
- **类别:** network_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

名称解析器返回了零个地址。常见于基于 DNS 的目标（dns:///）主机名无法解析，或自定义解析器返回空更新。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.50+ | active | — | — |

## 解决方案

1. **** (85% 成功率)
   ```
   Verify the target scheme and hostname resolve. Use passthrough for a literal address:
conn, _ := grpc.NewClient("passthrough:///10.0.0.5:50051", grpc.WithTransportCredentials(insecure.NewCredentials()))
Or fix DNS: `nslookup myservice.default.svc.cluster.local`
   ```
2. **** (80% 成功率)
   ```
   Register a custom resolver that logs address updates:
resolver.Register(&myResolver{})
   ```

## 无效尝试

- **** — Bypasses load balancing and breaks TLS SNI/hostname verification. (70% 失败率)
- **** — No addresses will ever appear if DNS is broken; waiting longer doesn't help. (90% 失败率)
