{"id":2440,"date":"2021-04-14T11:24:16","date_gmt":"2021-04-14T15:24:16","guid":{"rendered":"https:\/\/bitpost.com\/news\/?p=2440"},"modified":"2021-04-14T12:39:52","modified_gmt":"2021-04-14T16:39:52","slug":"systemd-resolved-hates-your-lans-single-label-hosts","status":"publish","type":"post","link":"https:\/\/bitpost.com\/news\/2021\/systemd-resolved-hates-your-lans-single-label-hosts\/","title":{"rendered":"systemd-resolved hates your LAN&#8217;s single-label hosts"},"content":{"rendered":"\n<p>TL;DR add this config to dnsmasq.conf to expand your LAN single-label hosts into FQDNs that systemd won&#8217;t hate:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>domain=mydomain.lan\nlocal=\/mydomain.lan\/\nexpand-hosts<\/code><\/pre>\n\n\n\n<p>For decades, DNS resolution was fine, and then systemd arrived and it was not.  For the past couple years, for me and many others, systemd-resolved has been quite a headache, failing basic DNS resolution on any fresh Ubuntu (and other) installs.  A real joy when you just want to get things going ASAP.  After years of getting around it with shitty hacks, I finally nailed down what was going on.<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/poettering\">Poettering<\/a> and his crew decided that &#8220;single-label&#8221; host names on your LAN should never be allowed to resolve, even though it always used to in what he calls <a href=\"https:\/\/github.com\/systemd\/systemd\/pull\/15501#discussion_r413882405\">&#8220;classic DNS&#8221;<\/a>.  The systemd-resolved DNS handler in a vanilla install of Ubuntu 20.04 will drop your name resolution requests simply because the name does not have a dot in it.  End of story.  How nice.  This awful default behavior follows some <a href=\"https:\/\/www.iab.org\/documents\/correspondence-reports-documents\/2013-2\/iab-statement-dotless-domains-considered-harmful\/\">2013 guidelines<\/a> that were never previously enforced, at least not on me.<\/p>\n\n\n\n<p>I use the simplest possible solutions that work, and for me that is dnsmasq.  You can use one config file to configure static IPs for the MACs of all your LAN boxes.  I just needed to reconfigure it to expand single-label names into longer &#8220;fake&#8221; FQDNs, with some dnsmasq hackery, and DNS on new boxes now works out of the gate.  See the top of post (or <a href=\"https:\/\/askubuntu.com\/a\/918161\/276038\">this SO answer<\/a>) for the configuration details.<\/p>\n\n\n\n<p>There are supposed to be other solutions, like <a href=\"https:\/\/github.com\/systemd\/systemd\/issues\/13763#issuecomment-798967728\">flipping on the LLMNR flag<\/a> of systemd-resolved.  That didn&#8217;t work for me, and I don&#8217;t want to have to futz with every single new LAN box and VM anyway.  Hopefully this nightmare is behind me now.  I hope for you, as well.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>TL;DR add this config to dnsmasq.conf to expand your LAN single-label hosts into FQDNs that systemd won&#8217;t hate: For decades, DNS resolution was fine, and then systemd arrived and it was not. For the past couple years, for me and many others, systemd-resolved has been quite a headache, failing basic DNS resolution on any fresh [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[10],"tags":[],"class_list":["post-2440","post","type-post","status-publish","format-standard","hentry","category-tricks-tips-tools"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9M11L-Dm","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/2440","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/comments?post=2440"}],"version-history":[{"count":5,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/2440\/revisions"}],"predecessor-version":[{"id":2449,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/2440\/revisions\/2449"}],"wp:attachment":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/media?parent=2440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/categories?post=2440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/tags?post=2440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}