Recently, I'm working on an IOS project which using a local vpn to redirect dns packages to a local dns proxy.The app works quite well,but I'm still confused about the mechenism of NEPacketTunnelProvider.
My question is:DNS query(destination IP:198.X.X.X which is the local dns proxy's IP) will be sent to tunnel interface according to routing rules.The packages will be sent to local tunnel server(IP:127.1.1.1) after they entered tunnel client(tunnel interface),and when the server send them to local dns proxy(198.X.X.X),I think they will be sent to the tunnel interface again which cause the dns packages will never reach dns proxy.From the result I know this is not right,but where is my mistake?