Page 1 of 1

Disable IPv6

Posted: 11 May 2018 18:44
by haloweenj
Hello,

I made a small linux program that uses libVLC to simulate remote video playback without actually rendering the video (to test if playback stops due to buffer underrun).

This is working fine, but I needed to turn IPv6 off so that, when performing DNS resolution, no AAAA queries are sent.

I was going to try to pass the --ipv4 arg to libvlc_new(), but I just found out that this option is no longer supported since 2.0.0 (I'm using 3.0.0). I've crawled through both the command line and API documentation, but I cannot find any alternative.

Is there any way to disable IPv6 with version 3.0.0?

Thank you for your help.

Re: Disable IPv6

Posted: 11 May 2018 19:46
by Rémi Denis-Courmont
That depends on the OS, this is not in scope of LibVLC.

Re: Disable IPv6

Posted: 14 May 2018 12:40
by haloweenj
Hello Rémi,

I agree with you in principle, but that is not the case with most applications and libs in linux. I've tried

Code: Select all

sysctl -w net.ipv6.conf.all.disable_ipv6=1
but there were still DNS queries for both A and AAAA records. From what I could gather, there is not other way on linux to disable DNS AAAA requests. Maybe that's why other libs (e.g. libcurl) and applications (e.g. wget, ping) have options to force IPv4 or IPv6 and, apparently, so did VLC at one time.

Anyway, if you know of a way to disable these requests at the OS level, please let me know.

Re: Disable IPv6

Posted: 14 May 2018 12:44
by InTheWings
dns queries does depend on nsswitch, not configured ip.

Re: Disable IPv6

Posted: 14 May 2018 13:48
by haloweenj
Yes but, AFAIK, there is no configuration on the nsswitch to disable AAAA DNS queries.