野声

Hey, 野声!

谁有天大力气可以拎着自己飞呀
twitter
github

MacOS "Regenerate" /etc/resolv.conf

I want to set up a DNS server on my local machine. However, I accidentally deleted /etc/resolv.conf and tried restarting multiple times to recover it, but it didn't work.

So, I did some research and found that /etc/resolv.conf is actually a symbolic link to /var/run/resolv.conf.

soft link

Solution

Therefore, the solution is simple:

sudo ln -s /var/run/resolv.conf /etc/resolv.conf

Reference

  1. How to force MacOS to regenerate /etc/resolv.conf file?
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.