How to get punjab/twisted to bypass dns

落花浮王杯 提交于 2019-12-11 06:48:08

问题


I am trying to get a punjab BOSH server to work with a development XMPP server. punjab is trying to do a SRV DNS lookup of the XMPP domain, which is not present in our DNS infrastructure. Is there any way I configure punjab to route requests for "myserver.mydomain.com" to an IP address? I do not have access to the xmpp:route attribute at the XML-level, so this would have to be done somehow by punjab/twisted configuration.


回答1:


As a quick hack to get you up and running, install dnsmasq, add the following to the config file:

srv-host=_xmpp-client._tcp.myserver.mydomain.com,localhost,5222,0
# use your DNS server here instead of 8.8.8.8, which is Google's
server=8.8.8.8

Start dnsmasq. I recommend starting with sudo dnsmasq -dq to start with, so you can see the debug output and diagnose any problems.

Modify your network configuration to use 127.0.0.1 as your DNS server. E.g., but check for your OS, set resolv.conf to:

nameserver 127.0.0.1

This will run a small DNS resolver locally on your box, server up the one SRV record locally, and forward everything else to your upstream DNS server.



来源:https://stackoverflow.com/questions/6988080/how-to-get-punjab-twisted-to-bypass-dns

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!