Thank you for your answers.
In search of ease way, I took closer look to Openfire server, that is written on Java. I have set up proxy using internal Java settings. And this settings applied both to traffic and to DNS. So my problem got solved without proxychains either. Anyway, thank you. With your help I got clear understanding.