Dear Maintainer, executes resolvconf does not parse it correcty as it does not end in a newline. For this I changed "$R" to "$R\n" and it worked(on this senario my server.conf had only one 'push dhcp-option DNS x.x.x.x") (It also worked and pushed correctly 2 diffrent dhcp-options in this senario, because I thought that maybe my solution would break adding more dhcp-option, but it looks like it does not.) I don't know if adding a "\n" could be a good solution. Please inform me about the output of this bug report. Thanks in advance, Iliana.
Hi Iliana, When added server side, "push" is required for this option to be sent to the client. That's the right way to configure it as far as I know. Regards, Simon
Hi Iliana, When added server side, "push" is required for this option to be sent to the client. That's the right way to configure it as far as I know. Regards, Simon
push "dhcp-option DNS X.X.X.X" which didn't work so I started debugging the script only to find out that the value passed to resolvconf wasn't acceptable due to the lack of a newline at the "EOF" In order to fix this by only performing changes server-side, I duplicated the dhcp-option so that, from the two lines generated by update-resolv-conf at least the first one would contain a newline. so, in my server configuration I had: push "dhcp-option DNS X.X.X.X" push "dhcp-option DNS X.X.X.X" which does not seem right to me. Doing so, resolved the problem. To reproduce this, you just need an OpenVPN installation that pushes a single DNS server to its clients.
push "dhcp-option DNS X.X.X.X" which didn't work so I started debugging the script only to find out that the value passed to resolvconf wasn't acceptable due to the lack of a newline at the "EOF" In order to fix this by only performing changes server-side, I duplicated the dhcp-option so that, from the two lines generated by update-resolv-conf at least the first one would contain a newline. so, in my server configuration I had: push "dhcp-option DNS X.X.X.X" push "dhcp-option DNS X.X.X.X" which does not seem right to me. Doing so, resolved the problem. To reproduce this, you just need an OpenVPN installation that pushes a single DNS server to its clients.
That's weird as the relevant line in the script does add a newline by
having the double quote closed on the next line:
for NS in $NMSRVRS ; do
R="${R}nameserver $NS
"
done
echo -n "$R" | /sbin/resolvconf -a "${dev}.openvpn"
In order to debug this further, would you mind running those commands
(as root) and share the output:
ls -l /etc/resolv.conf
for f in /etc/resolv.conf /run/resolvconf/interface/*; do
echo "pre $(basename $f):"
cat "$f"
done
TRUNCATE_NAMESERVER_LIST_AFTER_LOOPBACK_ADDRESS=no \
foreign_option_1='dhcp-option DNS 4.2.2.1' \
dev=tun0 script_type=up \
/etc/openvpn/update-resolv-conf
for f in /etc/resolv.conf /run/resolvconf/interface/*; do
echo "up $(basename $f):"
cat "$f"
done
TRUNCATE_NAMESERVER_LIST_AFTER_LOOPBACK_ADDRESS=no \
foreign_option_1='dhcp-option DNS 4.2.2.1' \
dev=tun0 script_type=down \
/etc/openvpn/update-resolv-conf
for f in /etc/resolv.conf /run/resolvconf/interface/*; do
echo "down $(basename $f):"
cat "$f"
done
Thanks,
Simon
That's weird as the relevant line in the script does add a newline by
having the double quote closed on the next line:
for NS in $NMSRVRS ; do
R="${R}nameserver $NS
"
done
echo -n "$R" | /sbin/resolvconf -a "${dev}.openvpn"
In order to debug this further, would you mind running those commands
(as root) and share the output:
ls -l /etc/resolv.conf
for f in /etc/resolv.conf /run/resolvconf/interface/*; do
echo "pre $(basename $f):"
cat "$f"
done
TRUNCATE_NAMESERVER_LIST_AFTER_LOOPBACK_ADDRESS=no \
foreign_option_1='dhcp-option DNS 4.2.2.1' \
dev=tun0 script_type=up \
/etc/openvpn/update-resolv-conf
for f in /etc/resolv.conf /run/resolvconf/interface/*; do
echo "up $(basename $f):"
cat "$f"
done
TRUNCATE_NAMESERVER_LIST_AFTER_LOOPBACK_ADDRESS=no \
foreign_option_1='dhcp-option DNS 4.2.2.1' \
dev=tun0 script_type=down \
/etc/openvpn/update-resolv-conf
for f in /etc/resolv.conf /run/resolvconf/interface/*; do
echo "down $(basename $f):"
cat "$f"
done
Thanks,
Simon
I'm surprised this points to /etc and not /run (or /var/run). This is a bogus entry and I don't know how it ended up in there. Did this occur with the original update-resolv-conf script? This time it's good and /etc/resolv.conf was properly configured. And /etc/resolv.conf is properly cleaned up when you "down" the connection. So other than the weird glitch of "dhcp-option" showing up in tun0.openvpn, everything looks sane. Regards, Simon