Friday, April 26, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 5345  / 1 Year ago, mon, april 17, 2023, 12:59:40

When I go to me.com in chrome it tells me that domain can't be found. When I go to me.com with ssh, it connects to that server. When I try to ping me.com it pings localhost. I want me.com to resolve to localhost in all 3 situations. How can I accomplish this?



Here are my relevant files:



/etc/hosts



127.0.0.1       localhost.localdomain   localhost me.com
::1 laptop localhost6.localdomain6 localhost6
127.0.1.1 laptop


/etc/resolv.conf:



# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
nameserver 127.0.0.1


/etc/resolvconf/resolv.conf.d/head



# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1

More From » dns

 Answers
3

Unless you're actually running a DNS server such as BIND or dnsmasq on the localhost, you don't want your nameserver stanzas to point to the localhost. If you are running a DNS server or caching service, you'll need to refer to its documentation for details on how to configure it so me.com resolves to the localhost. Once the DNS service is configured, you can test resolution of specific domain names with nslookup.



Chrome may be automatically appending 'www' to the front of your URL, you can make sure this is behavior is disabled by specifying the protocol portion of the URL explicitly, like so: "http://me.com"



We'd need to see your /etc/nsswitch.conf file to help with the ssh connection. ssh -v may also produce some useful output.



Finally, if you want to connect to the localhost, it may be much less of a headache to simply specify 'localhost' as your hostname, instead of 'me.com' :)


[#40804] Monday, April 17, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lawain

Total Points: 150
Total Questions: 106
Total Answers: 101

Location: China
Member since Mon, Aug 22, 2022
2 Years ago
;