# rpc error: code = Unavailable desc = name resolver error: failed to query DNS: lookup myservice.example.com: no such host

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

## Root Cause

The DNS name used in the gRPC target cannot be resolved, often due to incorrect hostname or DNS misconfiguration.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.0 | active | — | — |
| 1.1 | active | — | — |

## Workarounds

1. **Verify the DNS record and correct the hostname.** (95% success)
   ```
   Use nslookup or dig to check: nslookup myservice.example.com. Update the target address accordingly.
   ```
2. **Use an IP address directly instead of a hostname.** (90% success)
   ```
   conn, err := grpc.Dial("10.0.0.1:8080", grpc.WithInsecure())
   ```

## Dead Ends

- **Use a random IP address hoping it resolves.** — The client specifically tries to resolve the given name; random IPs are ignored. (100% fail)
- **Ignore the error and retry indefinitely.** — Without DNS resolution, the connection will never succeed. (100% fail)
