2

As you can see here (and in man resolv.conf), there is an option named use-vc for resolv.conf to force Ubuntu to use TCP for DNS queries instead of UDP.

use-vc (since glibc 2.14)

Sets RES_USEVC in _res.options. This option forces the use of TCP for DNS resolutions.

This option doesn't work for me.

My Ubuntu:

ebrahim@ebrahim:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.10
Release:    16.10
Codename:   yakkety

ebrahim@ebrahim:~$ uname -a
Linux ebrahim 4.8.0-58-generic #63-Ubuntu SMP Mon Jun 26 17:08:21 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

ebrahim@ebrahim:~$ ldd --version
ldd (Ubuntu GLIBC 2.24-3ubuntu2.2) 2.24

As you see above, my glibc is newer version than the required version in the resolv.conf manual page.

This is my configuration file:

ebrahim@ebrahim:~$ cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
options use-vc
nameserver 8.8.8.8

But still DNS queries are on UDP:enter image description here

Why?

(Note that I have tried this option on 6 different Ubuntu OS, 3 of them was okay and 3 doesn't worked!)

Ebrahim Ghasemi
  • 197
  • 3
  • 16
  • 1
    did you even restart the networking service after making changes? Also, editing /etc/resolv.conf directly is the wrong way to make changes. Add additional settings to /etc/resolvconf/resolv.conf.d/head instead. – xR34P3Rx Sep 25 '17 at 05:26
  • As far as I know, restart is not required for /etc/resolv.conf changes (It was not required for those three Ubuntu which worked fine). Actually restart will rewrite this file! Anyway I add this option in the /etc/network/interfaces and in the /etc/resolvconf/resolv.conf.d/head, and then I restarted networking service, but nothing changed. – Ebrahim Ghasemi Sep 25 '17 at 06:44
  • I was just letting you know the proper way to make changes. Why do you want to use TCP anyway? – xR34P3Rx Sep 25 '17 at 11:42
  • @xR34P3Rx I want to disable UDP DNS traffic in my network to mitigate Reflected DNS Flood attack to my network. – Ebrahim Ghasemi Sep 25 '17 at 12:04
  • 2
    What Ubuntu versions did you try? Which worked, which didn't? Please add all information to your question rather than using comments! – dessert Sep 27 '17 at 08:54
  • Ubuntu 16.10 is no longer supported as of July 20 of 2017. https://askubuntu.com/questions/91815/how-to-install-software-or-upgrade-from-an-old-unsupported-release might be useful for you. – Elder Geek Sep 30 '17 at 16:30

0 Answers0