Which .conf file.?
Should work if you put it in ANYTHING.conf within /etc/sysctl.d
So long as the sysctl service is enabled.
Take note of the following.
So if you happen to have created /etc/sysctl.conf (I say created as it doesn't exist on my system) and there's a file named the same in one of the previous directories /etc/sysctl.conf would be ignored. Unlikely but you never know.
Another option is just to add ipv6.disable=1 to the kernel cmdline. Which is how I do it. Why I did it like that can't remember ?