# rpc error: code = Unavailable desc = connection error: desc = "transport: error while dialing: dial tcp: lookup myservice on 8.8.8.8:53: no such host"

- **ID:** `go/grpc-unavailable-dns-probe`
- **Domain:** go
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The DNS server cannot resolve the gRPC service hostname, often due to incorrect DNS configuration or service name typo.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.20 | active | — | — |
| 1.21 | active | — | — |

## Workarounds

1. **Use the service's IP address directly in the dial string.** (90% success)
   ```
   conn, err := grpc.Dial("10.0.0.5:50051", grpc.WithInsecure())
   ```
2. **Add the hostname to /etc/hosts or use a custom resolver.** (85% success)
   ```
   net.DefaultResolver = &net.Resolver{PreferGo: true, Dial: func(ctx context.Context, network, address string) (net.Conn, error) { d := net.Dialer{}; return d.DialContext(ctx, "udp", "192.168.1.1:53") }}
   ```

## Dead Ends

- **Adding a random retry delay.** — DNS resolution still fails; delay doesn't fix the lookup. (95% fail)
- **Changing the DNS server to a public one like 1.1.1.1.** — Public DNS may not have the private service record. (70% fail)
