host doing unnecessary dns lookup for localhost
Check that you have files
listed before dns
for the hosts
entry in /etc/nsswitch.conf
.
[me@home]$ grep "^hosts" /etc/nsswitch.conf
hosts: files dns
If dns
comes first, then your system will always query DNS to resolve hostnames before falling back to /etc/hosts
.
Getting DNS error for curl localhost:8080
One guess is your http request is going through a proxy. You can unset the HTTP_PROXY
variable and try again.
Otherwise, try using 127.0.0.1
or the IP address for your machine. :8080
means the HTTP server is binding to all IPs.
DNS Lookup failed - Error with all browsers
Run the following from your command prompt.
nslookup www.millennialmedia.com
This should respond with an IP address as well as let you know your current DNS server that's resolving your requests. On my machine the output was as below which implies the site is accessible to me.
nslookup millennialmedia.com
Server: <hidden>
Address: <hidden>
Non-authoritative answer:
Name: millennialmedia.com
Addresses: 216.146.46.11
216.146.46.10
Root can resolve localhost, while normal user cannot
I guess that /etc/hosts
is not readable by ordinary users. What are the permissions of that file?
Related Topics
Postgres Copy Command, Binary File
Avoid Copying of Data Between User and Kernel Space and Vice-Versa
Setting Color Brightness on Linux/Xorg
What's The Meaning of This Sed Command? Sed 's%^.*/%%'
Code Behind Rstudio Server Export Function
Starting Youtrack as a Service Fails Without Error Message
How to Find Size of Heap Present in Linux
Kernel Oops Page Fault Error Codes for Arm
Is There Any General Interfaces on Linux to Simulate Mouse Movements and Click
Accept Multiple Lines of Input in a Bash Script
Pipe Sox Play Command to Stdout
Linux, How to Execute an Executable/Non-Executable File
Is There a Linker Flag to Force It to Load All Shared Libraries at Start Time
Tensorflow Recommended System Specifications
How to Combine Two Search Words with "Grep" (And)