Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > The Dungeon > Archived (Click Header To See Sub-Forums) > F26 Development Forum
FedoraForum Search

Forgot Password? Join Us!

F26 Development Forum F26 Development Forum Pretty much exactly what it sounds like it is. This is the place to discuss and assist in the community development of F26. WARNING: Any pre-release versions, Beta included, are for experienced testers only. Back up all existing data and read all threads in the version Development Forum before attempting an install. Errors can and will likely occur which may include data destruction or inability to boot other partitions on any and possibly all attached hard drives. While FedoraProject needs and appreciates testers, you must remember to report issues directly to Bugzilla, after checking for pre-existing bugs.

 
 
Thread Tools Search this Thread Display Modes
  #1  
Old 16th June 2017, 08:36 PM
rvgestel Offline
Registered User
 
Join Date: Jun 2017
Location: Elst, Netherlands
Posts: 3
linuxfedorafirefox
Post search domain not added to /etc/resolv.conf

looks like the nm-dhcp-helper does not add the current domain to /etc/resolv.conf.

nmcli con show eno1 | grep -i domain_search
DHCP4.OPTION[12]: domain_search = domain1. domain2.
DHCP4.OPTION[28]: requested_domain_search = 1

file: /var/lib/NetworkManager/dhclient-...eno1.lease
lease {
interface "eno1";
...
option domain-search "domain1.", "domain2.";
option domain-name "domain1";
...
}

contents of /etc/resolv.conf
# Generated by NetworkManager
search doman2
nameserver 192.168.1.2

However, the resolv.conf should contain: "search domain1 domain2"

If a domain3 is added on the dhcp server in the list of search domains, the resolv.conf still only contains search domain2 whereas the /var/lib/NetworkManager/dhclient...lease now also contains domain3 on the search list.
It looks like the nm-dhcp-helper is not generating the /etc/resolv.conf correctly using the info from the lease file on F26.

Any suggestions?
Regards,
Richard
  #2  
Old 17th June 2017, 02:29 PM
erm67 Offline
Registered User
 
Join Date: Jun 2014
Location: Italy
Posts: 88
linuxfedorafirefox
Re: search domain not added to /etc/resolv.conf

You should set the DHCP Domain search option in the server config, not on the client.

It is option 119 so for example, assuming your router runs dnsmasq you should use this option:

Code:
dhcp-option=119,home.restivo.org,restivo.org
It works perfectly for me since I have configured dnsmasq on my router to pass the 119 dhcp option.

Code:
giu 17 15:21:46 LenovoB590.lan dhclient[2802]: DHCPREQUEST on enp3s0 to 255.255.255.255 port 67 (xid=0x2b061d4b)
giu 17 15:21:46 LenovoB590.lan dhclient[2802]: DHCPACK from 192.168.0.1 (xid=0x2b061d4b)
giu 17 15:21:46 LenovoB590.lan NetworkManager[806]: <info>  [1497705706.7520] dhcp4 (enp3s0):   address 192.168.0.120
giu 17 15:21:46 LenovoB590.lan NetworkManager[806]: <info>  [1497705706.7521] dhcp4 (enp3s0):   plen 24 (255.255.255.0)
giu 17 15:21:46 LenovoB590.lan NetworkManager[806]: <info>  [1497705706.7521] dhcp4 (enp3s0):   gateway 192.168.0.1
giu 17 15:21:46 LenovoB590.lan NetworkManager[806]: <info>  [1497705706.7521] dhcp4 (enp3s0):   lease time 86400
giu 17 15:21:46 LenovoB590.lan NetworkManager[806]: <info>  [1497705706.7521] dhcp4 (enp3s0):   hostname 'LenovoB590'
giu 17 15:21:46 LenovoB590.lan NetworkManager[806]: <info>  [1497705706.7521] dhcp4 (enp3s0):   nameserver '192.168.0.1'
giu 17 15:21:46 LenovoB590.lan NetworkManager[806]: <info>  [1497705706.7521] dhcp4 (enp3s0):   domain name 'lan'
giu 17 15:21:46 LenovoB590.lan NetworkManager[806]: <info>  [1497705706.7522] dhcp (enp3s0):   domain search 'lan.'
giu 17 15:21:46 LenovoB590.lan NetworkManager[806]: <info>  [1497705706.7522] dhcp (enp3s0):   domain search 'erm67.own.domain.'

Last edited by erm67; 17th June 2017 at 02:30 PM. Reason: typo
  #3  
Old 17th June 2017, 08:37 PM
rvgestel Offline
Registered User
 
Join Date: Jun 2017
Location: Elst, Netherlands
Posts: 3
linuxfedorafirefox
Post Re: search domain not added to /etc/resolv.conf

Thanks for the response!
My dhcpd.conf actually contained:

option domain-search-order code 119 = string;
option domain-search-order "domain1 domain2";

worked like a charm on a F25 dhcp client; However, after upgrade to Fedora 26, NetworkManager generates a resolv.conf without a search domain.

Adding the following line to the dhcpd server :

option domain-search "domain1", "domain2" ;

results in a resolv.conf on the client which contains a search for domain2, not for domain1. If I add a domain3 to the dhcp server it still only adds domain2. If I only supply domain1, no search domain is generated in resolv.conf.

No clue yet why F26 behaves differently as opposed to F25.
Regards,
Richard
  #4  
Old 18th June 2017, 09:53 AM
erm67 Offline
Registered User
 
Join Date: Jun 2014
Location: Italy
Posts: 88
linuxfedorafirefox
Re: search domain not added to /etc/resolv.conf

Actually I made some some tests, since I also have the same problem, and it looks like either dhclient or NM helper does some sanitization on the domain search, I bet it requires the domain to be in the form xxx.yyy

If I add
119,xxx.yyy,zzz.iii
I get both domain in resolv.conf, instead if using
119,lan,xxx.yyy
only xxx.yyy gets added (I use .lan for my home network, like probably a lot of people)
I also tried other domain names without a dot (TLDs) like con net but they are always discarded ...... this might make sense or not.

Apparently NM supposedly should fix the problem adding the domain taken from the hostname if it is in the form xxx.yyy
https://github.com/heftig/NetworkMan...manager.c#L658

but it adds the full hostname to resolv.conf, this is probably a bug.
with the option
119,lan,xxx.yyy
and the hostname set to
host.lan
I get
search host.lan xxx.yyy
which doesn't make sense
If I set the hostname to
host.xxx.lan
I get
search xxx.yyy xxx.lan

which is correct. I don't know if there is a RFC prohibing the use of a TLD-like name for the home network. Now I have set home.lan as dns domain name for the local network and everything is fine.





IMHO it makes sense to discard TLDs from the domain search dhcp answer, but NM should add only the local domain taken from the hostname and not the full hostname in case it is in the fom xxx.yyy.


There are 2 bug reports open about that:

https://bugzilla.redhat.com/show_bug.cgi?id=1404350
https://bugzilla.redhat.com/show_bug.cgi?id=1455557

Additionally also Microsoft Windows server disallow the use of a TLD (or single label) as domain name, or considers it a bad practice:
https://social.technet.microsoft.com...derations.aspx

Last edited by erm67; 18th June 2017 at 01:46 PM.
  #5  
Old 20th June 2017, 01:49 PM
rvgestel Offline
Registered User
 
Join Date: Jun 2017
Location: Elst, Netherlands
Posts: 3
linuxfedorafirefox
Re: search domain not added to /etc/resolv.conf

Thanks erm67 for investigating. Yoiu are absolutely correct, it is about Top Level Domain usage which also for me occurs at home. I wasn't aware of this change on TLD, so I will change my local domain name as well in order to make sure that hosts will not be placed in the TLD.
Regards,
Richard
  #6  
Old 21st June 2017, 03:45 PM
erm67 Offline
Registered User
 
Join Date: Jun 2014
Location: Italy
Posts: 88
linuxfedorafirefox
Re: search domain not added to /etc/resolv.conf

Well NetworkManager could/should at least drop a line in the log, something like 'ignoring single label domain name', it's not forbidden by any RFC after all, just a bad practice. For me it's ok use home.lan as a domain, it works also better with other products.
There are probably millions of home routers configured that way, a line in the log could help people understand what's going on.
 

Tags
added, dhclient, domain, nm-dhcp-helper, or etc or resolvconf, resolv.conf, search

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
resolv.conf - different domain resolution per server mvrk Servers & Networking 1 14th November 2013 08:47 AM
resolv.conf ignores hosts file. host.conf is correct mlee07946 Servers & Networking 2 17th September 2013 08:37 PM
NetworkManager, resolv.conf, DNS search path rossgrady Servers & Networking 2 9th July 2008 03:39 AM
Fedora 8 resolv.conf / search issue billgreene Servers & Networking 3 3rd January 2008 11:07 PM
FF4 Cisco VPN client resolv.conf search space? petercv1 Servers & Networking 0 18th October 2005 10:40 PM


Current GMT-time: 14:40 (Saturday, 23-09-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat