Custom Local DNS with Ubuntu Clients

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

Custom Local DNS with Ubuntu Clients

Aero Maxx
Hi Everyone,

I have a single linux desktop client running Ubuntu, and have 2 physical servers that are on my network that providing DNS resolution.

I want the linux desktop to use the local servers for DNS resolution only, but Ubuntu somehow keeps finding the DNS server that is in the router/modem that my ISP has provided me with.

Is there a way I can stop the IP address of my router from being added to the /etc/resolv.conf file?

I tried removing the resolvconf package, but this broke things as for some reason I wasn't able to then create my own resolv.conf file.

Thanks for any help you are able to give me.


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Custom Local DNS with Ubuntu Clients

Colin Law
On 11 March 2018 at 15:53, Aero Maxx <[hidden email]> wrote:
> Hi Everyone,
>
> I have a single linux desktop client running Ubuntu, and have 2 physical
> servers that are on my network that providing DNS resolution.
>
> I want the linux desktop to use the local servers for DNS resolution only,
> but Ubuntu somehow keeps finding the DNS server that is in the router/modem
> that my ISP has provided me with.

Can't you change it in the router?

Colin

>
> Is there a way I can stop the IP address of my router from being added to
> the /etc/resolv.conf file?
>
> I tried removing the resolvconf package, but this broke things as for some
> reason I wasn't able to then create my own resolv.conf file.
>
> Thanks for any help you are able to give me.
>
>
> --
> ubuntu-users mailing list
> [hidden email]
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Custom Local DNS with Ubuntu Clients

Aero Maxx
The router is announcing itself to the network as the DNS server so Ubuntu picks up 192.168.1.1 in the /etc/resolv.conf file.

On 11 March 2018 at 16:01, Colin Law <[hidden email]> wrote:
On 11 March 2018 at 15:53, Aero Maxx <[hidden email]> wrote:
> Hi Everyone,
>
> I have a single linux desktop client running Ubuntu, and have 2 physical
> servers that are on my network that providing DNS resolution.
>
> I want the linux desktop to use the local servers for DNS resolution only,
> but Ubuntu somehow keeps finding the DNS server that is in the router/modem
> that my ISP has provided me with.

Can't you change it in the router?

Colin

>
> Is there a way I can stop the IP address of my router from being added to
> the /etc/resolv.conf file?
>
> I tried removing the resolvconf package, but this broke things as for some
> reason I wasn't able to then create my own resolv.conf file.
>
> Thanks for any help you are able to give me.
>
>
> --
> ubuntu-users mailing list
> [hidden email]
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Custom Local DNS with Ubuntu Clients

Aero Maxx
There is no option for DNS settings in the router GUI this is unfortunately locked down.

I could obviously buy a new router, but there must be a better way?

On 11 March 2018 at 17:02, Aero Maxx <[hidden email]> wrote:
The router is announcing itself to the network as the DNS server so Ubuntu picks up 192.168.1.1 in the /etc/resolv.conf file.

On 11 March 2018 at 16:01, Colin Law <[hidden email]> wrote:
On 11 March 2018 at 15:53, Aero Maxx <[hidden email]> wrote:
> Hi Everyone,
>
> I have a single linux desktop client running Ubuntu, and have 2 physical
> servers that are on my network that providing DNS resolution.
>
> I want the linux desktop to use the local servers for DNS resolution only,
> but Ubuntu somehow keeps finding the DNS server that is in the router/modem
> that my ISP has provided me with.

Can't you change it in the router?

Colin

>
> Is there a way I can stop the IP address of my router from being added to
> the /etc/resolv.conf file?
>
> I tried removing the resolvconf package, but this broke things as for some
> reason I wasn't able to then create my own resolv.conf file.
>
> Thanks for any help you are able to give me.
>
>
> --
> ubuntu-users mailing list
> [hidden email]
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users



--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Custom Local DNS with Ubuntu Clients

Tom H-4
In reply to this post by Aero Maxx
On Sun, Mar 11, 2018 at 11:53 AM, Aero Maxx <[hidden email]> wrote:

>
> I have a single linux desktop client running Ubuntu, and have 2
> physical servers that are on my network that providing DNS resolution.
>
> I want the linux desktop to use the local servers for DNS resolution
> only, but Ubuntu somehow keeps finding the DNS server that is in the
> router/modem that my ISP has provided me with.
>
> Is there a way I can stop the IP address of my router from being added
> to the /etc/resolv.conf file?
>
> I tried removing the resolvconf package, but this broke things as for
> some reason I wasn't able to then create my own resolv.conf file.
>
> Thanks for any help you are able to give me.

What is the app that's managing the network? NM? ifupdown? systemd-networkd?

Is resolvconf or systemd-resolved involved in setting up "/etc/resolv.conf"?

What's the output of "ls -l /etc/resolv.conf" and "cat /etc/resolv.conf"?

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Custom Local DNS with Ubuntu Clients

Ralf Mardorf-2
On Sun, 11 Mar 2018 13:33:03 -0400, Tom H wrote:

>On Sun, Mar 11, 2018 at 11:53 AM, Aero Maxx <[hidden email]>
>wrote:
>>
>> I have a single linux desktop client running Ubuntu, and have 2
>> physical servers that are on my network that providing DNS
>> resolution.
>>
>> I want the linux desktop to use the local servers for DNS resolution
>> only, but Ubuntu somehow keeps finding the DNS server that is in the
>> router/modem that my ISP has provided me with.
>>
>> Is there a way I can stop the IP address of my router from being
>> added to the /etc/resolv.conf file?
>>
>> I tried removing the resolvconf package, but this broke things as for
>> some reason I wasn't able to then create my own resolv.conf file.
>>
>> Thanks for any help you are able to give me.  
>
>What is the app that's managing the network? NM? ifupdown?
>systemd-networkd?
>
>Is resolvconf or systemd-resolved involved in setting up
>"/etc/resolv.conf"?
>
>What's the output of "ls -l /etc/resolv.conf" and
>"cat /etc/resolv.conf"?

What happens if you ensure that /etc/resolv.conf isn't a link, but an
immutable file? SICR


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Custom Local DNS with Ubuntu Clients

Aero Maxx
In reply to this post by Tom H-4
On 11 March 2018 at 17:33, Tom H <[hidden email]> wrote:
What is the app that's managing the network? NM? ifupdown? systemd-networkd?

I'm unsure, I'm using the default install of Ubuntu Desktop 16.04 LTS

Is resolvconf or systemd-resolved involved in setting up "/etc/resolv.conf"?

I believe it is resolvconf as this is installed by default.
 
What's the output of "ls -l /etc/resolv.conf" and "cat /etc/resolv.conf"?

root@ubuntu:~# ls -l /etc/resolv.conf
lrwxrwxrwx 1 root root 29 Mar 10 13:53 /etc/resolv.conf -> ../run/resolvconf/resolv.conf

root@ubuntu:~# 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
nameserver 127.0.1.1

Virus-free. www.avast.com

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Custom Local DNS with Ubuntu Clients

Aero Maxx
In reply to this post by Ralf Mardorf-2
On 11 March 2018 at 18:12, Ralf Mardorf <[hidden email]> wrote:
On Sun, 11 Mar 2018 13:33:03 -0400, Tom H wrote:
What happens if you ensure that /etc/resolv.conf isn't a link, but an
immutable file? SICR

Sure that would work as I could change the file and then make it immutable, but I'm not sure this is an acceptable solution.

There must be a better way surely than breaking functionality. 

Virus-free. www.avast.com

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Custom Local DNS with Ubuntu Clients

Aero Maxx
In reply to this post by Tom H-4
On 11 March 2018 at 17:33, Tom H <[hidden email]> wrote:
What is the app that's managing the network? NM? ifupdown? systemd-networkd?

It is Network Manager, if I configure the adapter in the top right corner, it has the DNS as follows.

Primary DNS: 192.168.0.1
Secondary DNS: 192.168.0.113
Ternary DNS: 192.168.0.114

I'm not wanting to bypass my DNS servers and don't want to use the Primary DNS server, as my DNS servers are set to query my ISP DNS servers for addresses that it doesn't know.

Virus-free. www.avast.com

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Custom Local DNS with Ubuntu Clients

Ralf Mardorf-2
In reply to this post by Aero Maxx
On Sun, 11 Mar 2018 18:37:13 +0000, Aero Maxx wrote:
>On 11 March 2018 at 18:12, Ralf Mardorf <[hidden email]> wrote:
>> What happens if you ensure that /etc/resolv.conf isn't a link, but an
>> immutable file? SICR
>
>
>Sure that would work as I could change the file and then make it
>immutable, but I'm not sure this is an acceptable solution.
>
>There must be a better way surely than breaking functionality.

Yesno.

Assuming this dirty workaround should work, it would be an acceptable
solution, since the "right" way to do it, much likely would break with
an upgrade as a dirty hack would do, too.

Fortunately for my real-time audio needs such issues are unimportant
and Linux provides advanced audio real-time capabilities. However, if
real-time audio wouldn't be my domain, I would consider to migrate to
FreeBSD [1], since it does less suffer from the Linux "heute hü und
morgen hott" approach [2].

[1]
The only issue with FreeBSD for non-real-time-audio usage is the new
utter crap CoC:

https://www.freebsd.org/internal/code-of-conduct.html

[2] I'm unable to translate it, so here we go:

"Es geht nicht an: heute hü, morgen hott oder andersherum.
We cannot tolerate things being done one way one day and a different
way the next for no apparent reason. Es geht nicht an: heute hü, morgen
hott oder andersherum. We cannot tolerate things being done one way one
day and a different way the next for no apparent reason." -
http://context.reverso.net/%C3%BCbersetzung/deutsch-englisch/h%C3%BC%2C+morgen+hott


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Custom Local DNS with Ubuntu Clients

Tom H-4
In reply to this post by Ralf Mardorf-2
On Sun, Mar 11, 2018 at 2:12 PM, Ralf Mardorf <[hidden email]> wrote:

> On Sun, 11 Mar 2018 13:33:03 -0400, Tom H wrote:
>> On Sun, Mar 11, 2018 at 11:53 AM, Aero Maxx <[hidden email]>
>> wrote:
>>>
>>> I have a single linux desktop client running Ubuntu, and have 2
>>> physical servers that are on my network that providing DNS
>>> resolution.
>>>
>>> I want the linux desktop to use the local servers for DNS resolution
>>> only, but Ubuntu somehow keeps finding the DNS server that is in the
>>> router/modem that my ISP has provided me with.
>>>
>>> Is there a way I can stop the IP address of my router from being
>>> added to the /etc/resolv.conf file?
>>>
>>> I tried removing the resolvconf package, but this broke things as for
>>> some reason I wasn't able to then create my own resolv.conf file.
>>>
>>> Thanks for any help you are able to give me.
>>
>> What is the app that's managing the network? NM? ifupdown?
>> systemd-networkd?
>>
>> Is resolvconf or systemd-resolved involved in setting up
>> "/etc/resolv.conf"?
>>
>> What's the output of "ls -l /etc/resolv.conf" and
>> "cat /etc/resolv.conf"?
>
> What happens if you ensure that /etc/resolv.conf isn't a link, but an
> immutable file? SICR

Only if the various tools that modify "/etc/resolv.conf" can't be made
to update it as desired.

Since they do, "chattr +i /etc/resolv.conf" is incompetent system
administration.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Custom Local DNS with Ubuntu Clients

Tom H-4
In reply to this post by Aero Maxx
On Sun, Mar 11, 2018 at 2:34 PM, Aero Maxx <[hidden email]> wrote:
> On 11 March 2018 at 17:33, Tom H <[hidden email]> wrote:


>> What is the app that's managing the network? NM? ifupdown? systemd-networkd?

> I'm unsure, I'm using the default install of Ubuntu Desktop 16.04 LTS

NM.


>> Is resolvconf or systemd-resolved involved in setting up "/etc/resolv.conf"?

> I believe it is resolvconf as this is installed by default.

OK.

 
>> What's the output of "ls -l /etc/resolv.conf" and "cat /etc/resolv.conf"?

> root@ubuntu:~# ls -l /etc/resolv.conf
> lrwxrwxrwx 1 root root 29 Mar 10 13:53 /etc/resolv.conf ->
> ../run/resolvconf/resolv.conf

> root@ubuntu:~# 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
> nameserver 127.0.1.1

So you have both resolvconf and dnsmasq running (IIRC, the Ubuntu default, as you say above).

AFAIK, you can drop a file into "/etc/dnsmasq.d/" with "server=nameserver_ip_address" to ensure that dnsmasq forwards queries to it.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Custom Local DNS with Ubuntu Clients

Tom H-4
On Sun, Mar 11, 2018 at 8:30 PM, Tom H <[hidden email]> wrote:

> On Sun, Mar 11, 2018 at 2:34 PM, Aero Maxx <[hidden email]> wrote:
>> On 11 March 2018 at 17:33, Tom H <[hidden email]> wrote:
>
>
>>> What is the app that's managing the network? NM? ifupdown?
>>> systemd-networkd?
>
>> I'm unsure, I'm using the default install of Ubuntu Desktop 16.04 LTS
>
> NM.
>
>
>>> Is resolvconf or systemd-resolved involved in setting up
>>> "/etc/resolv.conf"?
>
>> I believe it is resolvconf as this is installed by default.
>
> OK.
>
>
>>> What's the output of "ls -l /etc/resolv.conf" and "cat /etc/resolv.conf"?
>
>> root@ubuntu:~# ls -l /etc/resolv.conf
>> lrwxrwxrwx 1 root root 29 Mar 10 13:53 /etc/resolv.conf ->
>> ../run/resolvconf/resolv.conf
>
>> root@ubuntu:~# 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
>> nameserver 127.0.1.1
>
> So you have both resolvconf and dnsmasq running (IIRC, the Ubuntu default,
> as you say above).
>
> AFAIK, you can drop a file into "/etc/dnsmasq.d/" with
> "server=nameserver_ip_address" to ensure that dnsmasq forwards queries to
> it.

OOPS!

If you only have dnsmasq-base installed (which, AFAIR, is the
default), you have to use "/etc/NetworkManager/dnsmasq.d/" not
"/etc/dnsmasq.d/".

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Custom Local DNS with Ubuntu Clients

Tom H-4
In reply to this post by Aero Maxx
On Sun, Mar 11, 2018 at 2:42 PM, Aero Maxx <[hidden email]> wrote:
> On 11 March 2018 at 17:33, Tom H <[hidden email]> wrote:
>>
>> What is the app that's managing the network? NM? ifupdown?
>> systemd-networkd?
>
> It is Network Manager, if I configure the adapter in the top right
> corner, it has the DNS as follows.
>
> Primary DNS: 192.168.0.1
> Secondary DNS: 192.168.0.113
> Ternary DNS: 192.168.0.114

Given that "/etc/resolv.conf" is a symlink to "/run/resolvconf/resolv.conf", these nameservers must be unused because they must be in "/run/NetworkManager/resolv.conf" (I hope that the path is correct; I don't use any of these apps; at least not like this) if "dns=dnsmasq" in "/etc/NetworkManager/NetworkManager.conf".

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Custom Local DNS with Ubuntu Clients

Tom H-4
In reply to this post by Ralf Mardorf-2
On Sun, Mar 11, 2018 at 2:57 PM, Ralf Mardorf <[hidden email]> wrote:

> On Sun, 11 Mar 2018 18:37:13 +0000, Aero Maxx wrote:
>> On 11 March 2018 at 18:12, Ralf Mardorf <[hidden email]> wrote:
>>>
>>> What happens if you ensure that /etc/resolv.conf isn't a link, but an
>>> immutable file? SICR
>>
>> Sure that would work as I could change the file and then make it
>> immutable, but I'm not sure this is an acceptable solution.
>>
>> There must be a better way surely than breaking functionality.
>
> Yesno.
>
> Assuming this dirty workaround should work, it would be an acceptable
> solution, since the "right" way to do it, much likely would break with
> an upgrade as a dirty hack would do, too.

No. An upgrade wouldn't break the setup. That's the point of conffiles.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users