Replace direct type casts with `errors.As` in BDNS (#5121)
Replace direct type casts with `errors.As` in BDNS (#5121)

`errors.As` checks for a specific error in a wrapped error chain
(see https://golang.org/pkg/errors/#As) as opposed to asserting
that an error is of a specific type.

Part of #5010
jcjones/boulder,jcjones/boulder,bmw/boulder,letsencrypt/boulder,jcjones/boulder,jsha/boulder,bmw/boulder,letsencrypt/boulder,jsha/boulder,letsencrypt/boulder,jsha/boulder,jcjones/boulder,bmw/boulder