# UNAVAILABLE: dns resolver: failed to query DNS SRV record for _grpc._tcp.example.com: lookup _grpc._tcp.example.com: no such host

- **ID:** `grpc/name-resolver-failure-dns`
- **Domain:** grpc
- **Category:** network_error
- **Error Code:** `GRPC_DNS_SRV_LOOKUP_FAILED`
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

gRPC's DNS resolver tried to resolve a SRV record for the service but the DNS server returned NXDOMAIN because the SRV record is missing or misconfigured.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| gRPC-go v1.62.0 | active | — | — |
| gRPC-java v1.61.0 | active | — | — |
| C-core v1.62.0 | active | — | — |

## Workarounds

1. **Add the missing SRV record in DNS: _grpc._tcp.example.com. 3600 IN SRV 0 0 50051 server1.example.com. Also ensure A/AAAA records exist for server1.example.com.** (95% success)
   ```
   Add the missing SRV record in DNS: _grpc._tcp.example.com. 3600 IN SRV 0 0 50051 server1.example.com. Also ensure A/AAAA records exist for server1.example.com.
   ```
2. **Use the 'passthrough' resolver to bypass SRV lookup: set target URI to 'passthrough:///server1.example.com:50051' which resolves using standard A/AAAA records only.** (90% success)
   ```
   Use the 'passthrough' resolver to bypass SRV lookup: set target URI to 'passthrough:///server1.example.com:50051' which resolves using standard A/AAAA records only.
   ```
3. **Configure a custom resolver in code: in Go, implement resolver.Builder and register it with resolver.Register(myBuilder) to provide a static list of addresses.** (85% success)
   ```
   Configure a custom resolver in code: in Go, implement resolver.Builder and register it with resolver.Register(myBuilder) to provide a static list of addresses.
   ```

## Dead Ends

- **** — Adding a fallback to IP address in the target URI (e.g., dns:///192.168.1.1:50051) bypasses service discovery entirely, breaking load balancing and failover. (90% fail)
- **** — Disabling DNS resolution with grpc.lb_policy=round_robin does not fix the missing SRV record; the resolver still fails before load balancing starts. (85% fail)
