Internal Domain on OpenVPN with Dnsmasq
I'm trying to get dnsmaq and OpenVPN working together on DigitalOcean. I want to create a VPN that forwards the requests that end with *.local to the droplet and the others to be resolved by Google DNS.
This is my /etc/dnsmasq.conf
:
address=/.local/10.8.0.1
resolv-file=/etc/resolv.dnsmasq
listen-address=127.0.0.1
listen-address=10.8.0.1
bind-interfaces
server=8.8.8.8
server=8.8.4.4
This is my /etc/openvpn/server.conf
:
dev tun
proto udp
port 1194
ca ca.crt
cert server.crt
key server.key
dh dh2048.pem
server 10.8.0.0 255.255.255.0
push "route 10.8.0.0 255.255.255.0"
push "dhcp-option DNS 10.8.0.1"
push "redirect-gateway def1 bypass-dhcp"
ifconfig-pool-persist ipp.txt
keepalive 10 120
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3
In this moment I'm connected to the VPN and it works. I can open every website except the ones that end with *.local (getting ERR_NAME_NOT_RESOLVED).
Edit:
This is my /etc/resolv.conf
file:
# 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
nameserver 2001:4860:4860::8844
nameserver 2001:4860:4860::8888
nameserver 8.8.8.8
After installing dnsmasq it was nameserver 127.0.0.1
but every time I restart the server it returns to that above.
networking vpn dns openvpn ubuntu-14.04
add a comment |
I'm trying to get dnsmaq and OpenVPN working together on DigitalOcean. I want to create a VPN that forwards the requests that end with *.local to the droplet and the others to be resolved by Google DNS.
This is my /etc/dnsmasq.conf
:
address=/.local/10.8.0.1
resolv-file=/etc/resolv.dnsmasq
listen-address=127.0.0.1
listen-address=10.8.0.1
bind-interfaces
server=8.8.8.8
server=8.8.4.4
This is my /etc/openvpn/server.conf
:
dev tun
proto udp
port 1194
ca ca.crt
cert server.crt
key server.key
dh dh2048.pem
server 10.8.0.0 255.255.255.0
push "route 10.8.0.0 255.255.255.0"
push "dhcp-option DNS 10.8.0.1"
push "redirect-gateway def1 bypass-dhcp"
ifconfig-pool-persist ipp.txt
keepalive 10 120
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3
In this moment I'm connected to the VPN and it works. I can open every website except the ones that end with *.local (getting ERR_NAME_NOT_RESOLVED).
Edit:
This is my /etc/resolv.conf
file:
# 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
nameserver 2001:4860:4860::8844
nameserver 2001:4860:4860::8888
nameserver 8.8.8.8
After installing dnsmasq it was nameserver 127.0.0.1
but every time I restart the server it returns to that above.
networking vpn dns openvpn ubuntu-14.04
add a comment |
I'm trying to get dnsmaq and OpenVPN working together on DigitalOcean. I want to create a VPN that forwards the requests that end with *.local to the droplet and the others to be resolved by Google DNS.
This is my /etc/dnsmasq.conf
:
address=/.local/10.8.0.1
resolv-file=/etc/resolv.dnsmasq
listen-address=127.0.0.1
listen-address=10.8.0.1
bind-interfaces
server=8.8.8.8
server=8.8.4.4
This is my /etc/openvpn/server.conf
:
dev tun
proto udp
port 1194
ca ca.crt
cert server.crt
key server.key
dh dh2048.pem
server 10.8.0.0 255.255.255.0
push "route 10.8.0.0 255.255.255.0"
push "dhcp-option DNS 10.8.0.1"
push "redirect-gateway def1 bypass-dhcp"
ifconfig-pool-persist ipp.txt
keepalive 10 120
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3
In this moment I'm connected to the VPN and it works. I can open every website except the ones that end with *.local (getting ERR_NAME_NOT_RESOLVED).
Edit:
This is my /etc/resolv.conf
file:
# 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
nameserver 2001:4860:4860::8844
nameserver 2001:4860:4860::8888
nameserver 8.8.8.8
After installing dnsmasq it was nameserver 127.0.0.1
but every time I restart the server it returns to that above.
networking vpn dns openvpn ubuntu-14.04
I'm trying to get dnsmaq and OpenVPN working together on DigitalOcean. I want to create a VPN that forwards the requests that end with *.local to the droplet and the others to be resolved by Google DNS.
This is my /etc/dnsmasq.conf
:
address=/.local/10.8.0.1
resolv-file=/etc/resolv.dnsmasq
listen-address=127.0.0.1
listen-address=10.8.0.1
bind-interfaces
server=8.8.8.8
server=8.8.4.4
This is my /etc/openvpn/server.conf
:
dev tun
proto udp
port 1194
ca ca.crt
cert server.crt
key server.key
dh dh2048.pem
server 10.8.0.0 255.255.255.0
push "route 10.8.0.0 255.255.255.0"
push "dhcp-option DNS 10.8.0.1"
push "redirect-gateway def1 bypass-dhcp"
ifconfig-pool-persist ipp.txt
keepalive 10 120
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3
In this moment I'm connected to the VPN and it works. I can open every website except the ones that end with *.local (getting ERR_NAME_NOT_RESOLVED).
Edit:
This is my /etc/resolv.conf
file:
# 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
nameserver 2001:4860:4860::8844
nameserver 2001:4860:4860::8888
nameserver 8.8.8.8
After installing dnsmasq it was nameserver 127.0.0.1
but every time I restart the server it returns to that above.
networking vpn dns openvpn ubuntu-14.04
networking vpn dns openvpn ubuntu-14.04
asked Jun 16 '16 at 21:31
Henrique DiasHenrique Dias
613
613
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
After searching a bit, I saw that I hadn't opened the DNS Server port on the firewall. That was the problem.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1090216%2finternal-domain-on-openvpn-with-dnsmasq%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
After searching a bit, I saw that I hadn't opened the DNS Server port on the firewall. That was the problem.
add a comment |
After searching a bit, I saw that I hadn't opened the DNS Server port on the firewall. That was the problem.
add a comment |
After searching a bit, I saw that I hadn't opened the DNS Server port on the firewall. That was the problem.
After searching a bit, I saw that I hadn't opened the DNS Server port on the firewall. That was the problem.
answered Jun 17 '16 at 12:55
Henrique DiasHenrique Dias
613
613
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1090216%2finternal-domain-on-openvpn-with-dnsmasq%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown