Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

My goal is for clients to be able to connect to my wifi access point and access services on it using a hostname. Currently clients can connect and get assigned an IP by DHCP, but they cannot resolve a hostname. I have disabled network-manager's dnsmasq.

/etc/network/interfaces:

auto lo
iface lo inet loopback

auto wlan1
iface wlan1 inet static
address 192.168.0.1
broadcast 192.168.0.255
netmask 255.255.255.0

/etc/hosts:

127.0.0.1   localhost
127.0.1.1   foo
192.168.0.1 foo

/etc/hostapd/hostapd.conf:

interface=wlan1
driver=nl80211
ssid=Foo
hw_mode=g
channel=1
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0

/etc/dnsmasq.conf:

interface=wlan1
dhcp-range=192.168.0.1,192.168.0.150,12h

/etc/resolv.conf:

nameserver 127.0.0.1
search domain.invalid

dig @192.168.0.1 foo:

;; ANSWER SECTION:
foo.        0   IN  A   127.0.1.1
foo.        0   IN  A   192.168.0.1

When I connect to wlan1 with a Windows machine, it gets assigned IP 192.168.0.100, DHCP server = 192.168.0.1, DNS server = 192.168.0.1. But if I run ping foo it can't resolve the hostname. Thanks for your help.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.