Skip to content

Commit

Permalink
DNS resolver: Throw an error for non-default DNS authority. (#2067)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsha authored and lyuxuan committed Jun 4, 2018
1 parent 70e9c28 commit 2c5843e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions resolver/dns/dns_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ type dnsBuilder struct {

// Build creates and starts a DNS resolver that watches the name resolution of the target.
func (b *dnsBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOption) (resolver.Resolver, error) {
if target.Authority != "" {
return nil, fmt.Errorf("Default DNS resolver does not support custom DNS server")
}
host, port, err := parseTarget(target.Endpoint)
if err != nil {
return nil, err
Expand Down

0 comments on commit 2c5843e

Please sign in to comment.