First update your Pi Zero W to latest Stretch release!
Create or edit your wpa_supplicant configuration: sudo vi /etc/wpa_supplicant/wpa_supplicant.conf
Edit the interfaces configuration: sudo vi /etc/network/interfaces
Install hostapd and dnsmasq: sudo apt-get install hostapd dnsmasq
Create a new hostapd configuration: sudo vi /etc/hostapd/hostapd.conf
The new configuration should look like this, change your wifi ssid and password as your wish: interface=wlan1 ssid=Pi0W hw_mode=g channel=11 macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=2 wpa_passphrase=new_password wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP
Modify the hostapd default configuration to use your new configuration file: sudo vi /etc/default/hostapd
Add the following line: DAEMON_CONF=“/etc/hostapd/hostapd.conf”
Modify the dnsmasq configuration: sudo vi /etc/dnsmasq.conf
Modify sysctl.conf: sudo vi /etc/sysctl.conf
Uncomment the next line to enable packet forwarding for IPv4: net.ipv4.ip_forward=1
Modify the rc.local script to run some commands on boot up. sudo vi /etc/rc.local
Add the following line before “exit 0”. service dnsmasq start iptables -t nat -A POSTROUTING -s 192.168.10.0/24 ! -d 192.168.10.0/24 -j MASQUERADE ifdown wlan0 ifup wlan0
Last step, reboot your Pi Zero W: sudo reboot
Enjoy your new AP designed by Rasyberry Pi