LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-11-2021, 03:13 AM   #1
lvm_
Member
 
Registered: Jul 2020
Posts: 931

Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
name-specific DNS servers


Ubuntu with systemd-resolved. Computer is connected to the internet and work VPN. Work network has its own DNS and its own private hostnames resolvable only by its DNS but not by the public internet DNS. resolv.conf has nameserver entries for both networks, internet DNS first. When I am trying to resolve a private work hostname, internet DNS is connected first, returns not found error, and the name is not resolved. Works as designed - secondary nameserver should be contacted only in case of timeout or as round-robin, but obviously not the way I need it. My question is: how can I set it up to use work DNS to resolve private hostnames and internet DNS to resolve everything else? Essentially nameserver1 should be contacted if FQDN matches a domain list and nameserver2 if it doesn't. Obviously, I can set work DNS as primary - that's the workaround I am using now, but every time VPN is disconnected and reconnected systemd changes resolv.conf order back to default with internet first, also I am not comfortable with work DNS resolving all my requests to pron sites :)
 
Old 08-11-2021, 04:29 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by lvm_ View Post
Ubuntu with systemd-resolved. Computer is connected to the internet and work VPN. Work network has its own DNS and its own private hostnames resolvable only by its DNS but not by the public internet DNS. resolv.conf has nameserver entries for both networks, internet DNS first. When I am trying to resolve a private work hostname, internet DNS is connected first, returns not found error, and the name is not resolved. Works as designed - secondary nameserver should be contacted only in case of timeout or as round-robin, but obviously not the way I need it. My question is: how can I set it up to use work DNS to resolve private hostnames and internet DNS to resolve everything else? Essentially nameserver1 should be contacted if FQDN matches a domain list and nameserver2 if it doesn't. Obviously, I can set work DNS as primary - that's the workaround I am using now, but every time VPN is disconnected and reconnected systemd changes resolv.conf order back to default with internet first, also I am not comfortable with work DNS resolving all my requests to pron sites
Hi,

You could use a split dns configuration to resolve both internal and external hostnames
 
1 members found this post helpful.
Old 08-13-2021, 02:35 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by lvm_ View Post
Ubuntu with systemd-resolved. Computer is connected to the internet and work VPN.
I believe systemd-resolved is capable of assigning different DNS resolvers for different network connections, if I understand correctly?
I'm in a hurry now so I'll just throw you this link which helped me in the past & present:
https://wiki.archlinux.org/title/Systemd-resolved
https://wiki.archlinux.org/title/Domain_name_resolution
https://wiki.archlinux.org/title/Systemd-networkd
 
Old 08-13-2021, 08:11 AM   #4
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,142

Rep: Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264
You should be changing to your boss's IP when you browse pron sites.
 
  


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
[SOLVED] Direct specific client to specific server via DNS !! shahzaibcb Linux - Newbie 15 07-12-2014 02:09 AM
[SOLVED] /etc/network/interfaces - dhcp with specific DNS servers \/4A Linux - Networking 2 01-18-2013 12:00 PM
replace the existing dns servers with OPEN DNS servers in fedora 13 z99 Linux - Newbie 3 03-23-2011 09:29 AM
How to set DNS servers? How to stop auto change of DNS servers? newtovanilla Linux - Newbie 1 10-29-2008 09:19 PM
Setting name servers on multiple servers centosfan Linux - Server 3 01-23-2008 03:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:03 AM.

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