0

DNS rewrites with CNAME

I set 2 dns rewrite records in nextdns

ip.example.com: 192.168.0.100

domain.example.com: ip.example.com

 

NextDNS responds ip when it is an A record.

{"Status":0,"TC":false,"RD":true,"RA":true,"AD":false,"CD":false,"Question":[{"name":"domain.example.com.","type":1}],"Answer":[{"name":"domain.example.com.","type":5,"TTL":300,"data":"ip.example.com."}]}

But it only responds cname when it is a  CNAME, there's no IP in the response.

{"Status":0,"TC":false,"RD":true,"RA":true,"AD":false,"CD":false,"Question":[{"name":"ip.example.com.","type":1}],"Answer":[{"name":"ip.example.com.","type":1,"TTL":300,"data":"192.168.0.100"}]}

But if it is not a dns rewrite by nextdns, e.g. a normal CNAME record, nextdns will respond both cname and ip.

{"Status":0,"TC":false,"RD":true,"RA":true,"AD":false,"CD":false,"Question":[{"name":"www.nikkei.com.","type":1}],"Answer":[{"name":"www.nikkei.com.","type":5,"TTL":60,"data":"www-nikkei-com.n8s.jp."},{"name":"www-nikkei-com.n8s.jp.","type":5,"TTL":300,"data":"dualstack.m.sni.global.fastly.net."},{"name":"dualstack.m.sni.global.fastly.net.","type":1,"TTL":60,"data":"146.75.113.55"}],"Additional":[{"name":".","type":41,"TTL":0,"data":"\n;; OPT PSEUDOSECTION:\n; EDNS: version 0; flags:; udp: 1232"}]}

 

This behavior is OK when using macos/linux/ios, but it doesn't work on android.

On android, if the dns resolver gets only cname, it will not request to get the ip again. 

Please, any way to fix this?

Reply

null

Content aside

  • 1 mth agoLast active
  • 32Views
  • 1 Following