Fedora name resolution
-
@stacksofplates said in Fedora name resolution:
A couple things. As @scottalanmiller pointed out, make sure to check your /etc/resolve.conf. That gives you the DNS servers and search domain to query. If all of that lines up, then I would check your /etc/nsswitch.conf file and make sure dns is after files.
I notice with a clean install of Fedora 28, the nsswitch.conf is auto created and manage by authselect instead authconfig.
https://fedoraproject.org/wiki/Changes/AuthselectAsDefaultThe settings in the nsswitch.conf file is different too.
# Generated by authselect on Fri May 11 18:52:54 2018 # Do not modify this file manually. passwd: sss files systemd group: sss files systemd netgroup: sss files automount: sss files services: sss files sudoers: files shadow: files ethers: files netmasks: files networks: files protocols: files rpc: files hosts: files dns myhostname aliases: files nisplus bootparams: nisplus [NOTFOUND=return] files publickey: nisplus ~
By default the order for hosts is now
files, dns, myhostname
instead ofhosts: files mdns4_minimal [NOTFOUND=return] dns myhostname
from the previous Fedora releases. -
@black3dynamite said in Fedora name resolution:
@obsolesce said in Fedora name resolution:
@black3dynamite said in Fedora name resolution:
@obsolesce said in Fedora name resolution:
If it's a .local domain, edit the
avahi-daemon.conf
file:Un-comment the following line, and add a . (dot) infront of local:
domain-name=.local
Then restart network or reboot.
Why not edit
/etc/nsswitch.conf
instead?
https://ask.fedoraproject.org/en/question/90486/cannot-resolve-local-domain-name-on-fedora-23/?answer=90625#post-id-90625Change...
hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname
To...
hosts: files dns mdns4_minimal [NOTFOUND=return] myhostname
I wasn't aware of that option.
Can you tell me why one solution is better than the other or why one is worse than the other?
Has long as dns is after files in the hosts: section in nsswitch.conf file, utilities like nslookup should work correctly.
Un-commenting the .local line in the other file seems to do the job just fine. Still not seeing any advantages to doing it the other way, or disadvantages to keep doing it how I am.
-
@obsolesce said in Fedora name resolution:
@black3dynamite said in Fedora name resolution:
@obsolesce said in Fedora name resolution:
@black3dynamite said in Fedora name resolution:
@obsolesce said in Fedora name resolution:
If it's a .local domain, edit the
avahi-daemon.conf
file:Un-comment the following line, and add a . (dot) infront of local:
domain-name=.local
Then restart network or reboot.
Why not edit
/etc/nsswitch.conf
instead?
https://ask.fedoraproject.org/en/question/90486/cannot-resolve-local-domain-name-on-fedora-23/?answer=90625#post-id-90625Change...
hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname
To...
hosts: files dns mdns4_minimal [NOTFOUND=return] myhostname
I wasn't aware of that option.
Can you tell me why one solution is better than the other or why one is worse than the other?
Has long as dns is after files in the hosts: section in nsswitch.conf file, utilities like nslookup should work correctly.
Un-commenting the .local line in the other file seems to do the job just fine. Still not seeing any advantages to doing it the other way, or disadvantages to keep doing it how I am.
Only disadvantage or more of an inconvenience that I can see, is that you would have to keep changing the domain name because of each network uses a different domain like .local, .lan, or .home.
But I don't see anything wrong with un-commenting domain-name=local
-
@black3dynamite said in Fedora name resolution:
@obsolesce said in Fedora name resolution:
@black3dynamite said in Fedora name resolution:
@obsolesce said in Fedora name resolution:
@black3dynamite said in Fedora name resolution:
@obsolesce said in Fedora name resolution:
If it's a .local domain, edit the
avahi-daemon.conf
file:Un-comment the following line, and add a . (dot) infront of local:
domain-name=.local
Then restart network or reboot.
Why not edit
/etc/nsswitch.conf
instead?
https://ask.fedoraproject.org/en/question/90486/cannot-resolve-local-domain-name-on-fedora-23/?answer=90625#post-id-90625Change...
hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname
To...
hosts: files dns mdns4_minimal [NOTFOUND=return] myhostname
I wasn't aware of that option.
Can you tell me why one solution is better than the other or why one is worse than the other?
Has long as dns is after files in the hosts: section in nsswitch.conf file, utilities like nslookup should work correctly.
Un-commenting the .local line in the other file seems to do the job just fine. Still not seeing any advantages to doing it the other way, or disadvantages to keep doing it how I am.
Only disadvantage or more of an inconvenience that I can see, is that you would have to keep changing the domain name because of each network uses a different domain like .local, .lan, or .home.
But I don't see anything wrong with un-commenting domain-name=local
Right, /etc/nsswitch defines where you're looking. So correcting that fixes all scenarios vs fixing only one specific thing.
-
@stacksofplates said in Fedora name resolution:
@black3dynamite said in Fedora name resolution:
@obsolesce said in Fedora name resolution:
@black3dynamite said in Fedora name resolution:
@obsolesce said in Fedora name resolution:
@black3dynamite said in Fedora name resolution:
@obsolesce said in Fedora name resolution:
If it's a .local domain, edit the
avahi-daemon.conf
file:Un-comment the following line, and add a . (dot) infront of local:
domain-name=.local
Then restart network or reboot.
Why not edit
/etc/nsswitch.conf
instead?
https://ask.fedoraproject.org/en/question/90486/cannot-resolve-local-domain-name-on-fedora-23/?answer=90625#post-id-90625Change...
hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname
To...
hosts: files dns mdns4_minimal [NOTFOUND=return] myhostname
I wasn't aware of that option.
Can you tell me why one solution is better than the other or why one is worse than the other?
Has long as dns is after files in the hosts: section in nsswitch.conf file, utilities like nslookup should work correctly.
Un-commenting the .local line in the other file seems to do the job just fine. Still not seeing any advantages to doing it the other way, or disadvantages to keep doing it how I am.
Only disadvantage or more of an inconvenience that I can see, is that you would have to keep changing the domain name because of each network uses a different domain like .local, .lan, or .home.
But I don't see anything wrong with un-commenting domain-name=local
Right, /etc/nsswitch defines where you're looking. So correcting that fixes all scenarios vs fixing only one specific thing.
I see, that makes sense. I'll try that next time.... because my host name and the LAN domain I connect to never changes.
-
@black3dynamite said in Fedora name resolution:
@obsolesce said in Fedora name resolution:
If it's a .local domain, edit the
avahi-daemon.conf
file:Un-comment the following line, and add a . (dot) infront of local:
domain-name=.local
Then restart network or reboot.
Why not edit
/etc/nsswitch.conf
instead?
https://ask.fedoraproject.org/en/question/90486/cannot-resolve-local-domain-name-on-fedora-23/?answer=90625#post-id-90625Change...
hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname
To...
hosts: files dns mdns4_minimal [NOTFOUND=return] myhostname
That didn't work by the way.
This did:
hosts: files dns myhostname mymachines
-
It still didn't work correctly in VSCode, but did allow me to ping a .local.
I think the avahi-daemon.conf is the better way to fix it, as all issues are resolved that way, and no new ones arise down the road.
-
@obsolesce said in Fedora name resolution:
@black3dynamite said in Fedora name resolution:
@obsolesce said in Fedora name resolution:
If it's a .local domain, edit the
avahi-daemon.conf
file:Un-comment the following line, and add a . (dot) infront of local:
domain-name=.local
Then restart network or reboot.
Why not edit
/etc/nsswitch.conf
instead?
https://ask.fedoraproject.org/en/question/90486/cannot-resolve-local-domain-name-on-fedora-23/?answer=90625#post-id-90625Change...
hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname
To...
hosts: files dns mdns4_minimal [NOTFOUND=return] myhostname
That didn't work by the way.
This did:
hosts: files dns myhostname mymachines
I noticed on a clean install of Fedora 28, its setup this way:
hosts: files dns myhostname
-
@obsolesce said in Fedora name resolution:
It still didn't work correctly in VSCode, but did allow me to ping a .local.
What didn't work in VSCode?
-
Thank you all for your help with this problem.
I had this problem at a site I work at once a week. I went back there yesterday and things worked without me having to do anything so I don't know what was going on.
Anyway, all fixed & once again thanks.
-
@siringo said in Fedora name resolution:
Thank you all for your help with this problem.
I had this problem at a site I work at once a week. I went back there yesterday and things worked without me having to do anything so I don't know what was going on.
Anyway, all fixed & once again thanks.
Yeah we have a pretty big .local and I've never had to change anything for it.
Hopefully it stays working for you.