Skip to content

Instantly share code, notes, and snippets.

@moiseevigor
Last active October 15, 2020 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moiseevigor/a0e3859d5cd1e8d84022852d3d1e03ac to your computer and use it in GitHub Desktop.
Save moiseevigor/a0e3859d5cd1e8d84022852d3d1e03ac to your computer and use it in GitHub Desktop.
dns on macos

DNS and VPN on Macos

Install brew, it will install xcode-shell

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Install basic packages, in terminal

brew install htop bmon mtr wget openvpn

add some instructions to .zshrc

igor@igormac ~ % cat .zshrc 
alias ls='ls -G'
alias la='ls -lah'
alias pa='ps aux | grep'

bindkey "^[[A" history-search-backward
bindkey "^[[B" history-search-forward

export PATH="/usr/local/sbin:$PATH"

the last export is important!

Now let's fix DNS resolve issue on MacOS

~ % cd /usr/local/etc/openvpn
openvpn % wget https://raw.githubusercontent.com/andrewgdotcom/openvpn-mac-dns/master/etc/openvpn/update-resolv-conf
openvpn % chmod 755 update-resolv-conf

back home

cd ~

and fix the file my-verysecure.ovpn, delete the following lines

up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf

and place fixed one

up /usr/local/etc/openvpn/update-resolv-conf
down /usr/local/etc/openvpn/update-resolv-conf

now connect to VPN

~ % sudo openvpn .ssh/my-verysecure.ovpn 
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment