LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 05-03-2018, 06:59 AM   #1
TL_CLD
Member
 
Registered: Sep 2006
Posts: 366

Rep: Reputation: 45
18.04 - how to force usage of DNS server assigned by DHCP?


Hi all

How can I force 18.04 to always and only use the DNS server assigned to it by DHCP?

We have some 20 laptops running Slackware. We're testing Ubuntu, and so far this is a right proper showstopper. I can't for the life of me figure out why 18.04 insists on using the WAN addresses of all our servers, even when the laptop is on the LAN and its network is configured to use DHCP and a DNS that resolves hosts to their proper LAN addresses. The WAN address is perfectly fine when the laptops are outside of the LAN, but on the LAN we need the LAN addresses.

Note that this is our first attempt at Ubuntu. This has never been an issue with Slackware (nor the few OpenBSD machines we have). Those just do what we tell them to do, no more no less. Ubuntu 18.04 seems to have a will of its own when it comes to DNS.

We have these 4 scenarios:

Slackware machines on LAN, network configured by DHCP
$ host foo.mydomain
foo.mydomain has address [the hosts LAN address]
YAY! All is well

Slackware machines roaming, network configured by DHCP
$ host foo.mydomain
foo.mydomain has address [the hosts WAN address]
YAY! All is well

Ubuntu 18.04 machine on LAN, network configured by DHCP - TROUBLE AHEAD!
$ host foo.mydomain
foo.mydomain has address [the hosts WAN address]
WAN!! ARGH!!! What the heck??

Ubuntu 18.04 machine roaming, network configured by DHCP
$ host foo.mydomain
foo.mydomain has address [the hosts WAN address]
YAY! All is well

I hope (and suspect) this is all very simple, and that it is just us being stuck in our Slackware ways. Any and all help would be greatly appreciated.

Last edited by TL_CLD; 05-04-2018 at 03:30 AM.
 
Old 05-03-2018, 08:03 AM   #2
TL_CLD
Member
 
Registered: Sep 2006
Posts: 366

Original Poster
Rep: Reputation: 45
It seems I'm getting hit by the same problem as this individual:

https://github.com/systemd/systemd/issues/8851
 
Old 05-03-2018, 08:28 AM   #3
TL_CLD
Member
 
Registered: Sep 2006
Posts: 366

Original Poster
Rep: Reputation: 45
The plot thickens!

After reboot:

$ systemd-resolve foo.mydomain # returns proper LAN address
$ ping foo.mydomain # pings LAN address
$ systemd-resolve foo.mydomain # now returns WAN address
$ ping foo.mydomain # pings WAN

What. The. Heck.
 
Old 05-04-2018, 03:29 AM   #4
TL_CLD
Member
 
Registered: Sep 2006
Posts: 366

Original Poster
Rep: Reputation: 45
Solved by doing the following:

1. Add domains to /etc/systemd/resolved.conf
2. rm /etc/resolv.conf
3. ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
4. reboot

This seems to have fixed the issue, for now at least.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I perform maintenance on a master DNS/DHCP (BIND9/ISC-DHCP) Ubuntu server? Sniperm4n Linux - Server 2 09-09-2013 01:19 PM
Baffling DNS from a DHCP server problem. Appears to be ignoring dhcp.conf royce2020 Linux - Networking 1 02-16-2010 12:40 PM
Unable to resolve hostname / IP assigned by DHCP server. rmvinodh123 Linux - Networking 1 10-15-2007 07:00 AM
How to force DNS in DHCP (Ubuntu)? Micro420 Linux - Networking 2 07-31-2007 01:41 AM
eth0 ip assigned by dhcp , how would i know the ip address of the dhcp server where.. kublador Linux - Networking 14 05-16-2006 06:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 06:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration