How can I create a local DNS that is seen from other computers on my local network?
up vote
1
down vote
favorite
I'm trying to create a local DNS on my computer so I can access it locally with a DNS address instead of an IP. The first thing that I did was to configure my hostname on the files /etc/hosts
and /etc/init.d/hostname.sh
.
$ sudo vi /etc/hosts
127.0.0.1 localhost
127.0.1.1 mynewhostname
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
$ sudo vi /etc/hostname
mynewhostname
Then I installed the avahi-daemon as a DNS server:
sudo apt-get install avahi-daemon
After rebooting the system I can access the local DNS mynewhostname.local
only from localhost
(only from my own computer), other computers on the local network can only access my computer with the IP address and not with the DNS. Does anyone know why that happens? Or what would be a different approach to create a local DNS that's seen from all my local network?
server 18.04 dns ip localhost
add a comment |
up vote
1
down vote
favorite
I'm trying to create a local DNS on my computer so I can access it locally with a DNS address instead of an IP. The first thing that I did was to configure my hostname on the files /etc/hosts
and /etc/init.d/hostname.sh
.
$ sudo vi /etc/hosts
127.0.0.1 localhost
127.0.1.1 mynewhostname
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
$ sudo vi /etc/hostname
mynewhostname
Then I installed the avahi-daemon as a DNS server:
sudo apt-get install avahi-daemon
After rebooting the system I can access the local DNS mynewhostname.local
only from localhost
(only from my own computer), other computers on the local network can only access my computer with the IP address and not with the DNS. Does anyone know why that happens? Or what would be a different approach to create a local DNS that's seen from all my local network?
server 18.04 dns ip localhost
have you tried addingmachine-network-ip myhostname
in /etc/hosts in addition to127.0.0.1 myhostname
?
– ptetteh227
Nov 14 at 10:27
@ptetteh227 I've tried that just now and rebooted the computer... But the DNS is still only available from my computer.
– Rafael Muynarsk
Nov 14 at 10:59
avoid using .local and use say .home. how many computers form the network?. If there are few computers you could manually enter into each machine's hosts file themachine-network-ip hostname.home
of the other pc on the network. but if there are lots of computers consider dnsmasq.
– ptetteh227
Nov 14 at 16:15
Keep in mind there isn't a DNS 'server' running open to the world on your computer by default. Avahi-Daemon is typically used for local mDNS things not network-wide normal DNS lookups.
– Thomas Ward♦
Nov 16 at 15:50
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm trying to create a local DNS on my computer so I can access it locally with a DNS address instead of an IP. The first thing that I did was to configure my hostname on the files /etc/hosts
and /etc/init.d/hostname.sh
.
$ sudo vi /etc/hosts
127.0.0.1 localhost
127.0.1.1 mynewhostname
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
$ sudo vi /etc/hostname
mynewhostname
Then I installed the avahi-daemon as a DNS server:
sudo apt-get install avahi-daemon
After rebooting the system I can access the local DNS mynewhostname.local
only from localhost
(only from my own computer), other computers on the local network can only access my computer with the IP address and not with the DNS. Does anyone know why that happens? Or what would be a different approach to create a local DNS that's seen from all my local network?
server 18.04 dns ip localhost
I'm trying to create a local DNS on my computer so I can access it locally with a DNS address instead of an IP. The first thing that I did was to configure my hostname on the files /etc/hosts
and /etc/init.d/hostname.sh
.
$ sudo vi /etc/hosts
127.0.0.1 localhost
127.0.1.1 mynewhostname
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
$ sudo vi /etc/hostname
mynewhostname
Then I installed the avahi-daemon as a DNS server:
sudo apt-get install avahi-daemon
After rebooting the system I can access the local DNS mynewhostname.local
only from localhost
(only from my own computer), other computers on the local network can only access my computer with the IP address and not with the DNS. Does anyone know why that happens? Or what would be a different approach to create a local DNS that's seen from all my local network?
server 18.04 dns ip localhost
server 18.04 dns ip localhost
edited Nov 16 at 15:55
asked Nov 14 at 2:44
Rafael Muynarsk
485518
485518
have you tried addingmachine-network-ip myhostname
in /etc/hosts in addition to127.0.0.1 myhostname
?
– ptetteh227
Nov 14 at 10:27
@ptetteh227 I've tried that just now and rebooted the computer... But the DNS is still only available from my computer.
– Rafael Muynarsk
Nov 14 at 10:59
avoid using .local and use say .home. how many computers form the network?. If there are few computers you could manually enter into each machine's hosts file themachine-network-ip hostname.home
of the other pc on the network. but if there are lots of computers consider dnsmasq.
– ptetteh227
Nov 14 at 16:15
Keep in mind there isn't a DNS 'server' running open to the world on your computer by default. Avahi-Daemon is typically used for local mDNS things not network-wide normal DNS lookups.
– Thomas Ward♦
Nov 16 at 15:50
add a comment |
have you tried addingmachine-network-ip myhostname
in /etc/hosts in addition to127.0.0.1 myhostname
?
– ptetteh227
Nov 14 at 10:27
@ptetteh227 I've tried that just now and rebooted the computer... But the DNS is still only available from my computer.
– Rafael Muynarsk
Nov 14 at 10:59
avoid using .local and use say .home. how many computers form the network?. If there are few computers you could manually enter into each machine's hosts file themachine-network-ip hostname.home
of the other pc on the network. but if there are lots of computers consider dnsmasq.
– ptetteh227
Nov 14 at 16:15
Keep in mind there isn't a DNS 'server' running open to the world on your computer by default. Avahi-Daemon is typically used for local mDNS things not network-wide normal DNS lookups.
– Thomas Ward♦
Nov 16 at 15:50
have you tried adding
machine-network-ip myhostname
in /etc/hosts in addition to 127.0.0.1 myhostname
?– ptetteh227
Nov 14 at 10:27
have you tried adding
machine-network-ip myhostname
in /etc/hosts in addition to 127.0.0.1 myhostname
?– ptetteh227
Nov 14 at 10:27
@ptetteh227 I've tried that just now and rebooted the computer... But the DNS is still only available from my computer.
– Rafael Muynarsk
Nov 14 at 10:59
@ptetteh227 I've tried that just now and rebooted the computer... But the DNS is still only available from my computer.
– Rafael Muynarsk
Nov 14 at 10:59
avoid using .local and use say .home. how many computers form the network?. If there are few computers you could manually enter into each machine's hosts file the
machine-network-ip hostname.home
of the other pc on the network. but if there are lots of computers consider dnsmasq.– ptetteh227
Nov 14 at 16:15
avoid using .local and use say .home. how many computers form the network?. If there are few computers you could manually enter into each machine's hosts file the
machine-network-ip hostname.home
of the other pc on the network. but if there are lots of computers consider dnsmasq.– ptetteh227
Nov 14 at 16:15
Keep in mind there isn't a DNS 'server' running open to the world on your computer by default. Avahi-Daemon is typically used for local mDNS things not network-wide normal DNS lookups.
– Thomas Ward♦
Nov 16 at 15:50
Keep in mind there isn't a DNS 'server' running open to the world on your computer by default. Avahi-Daemon is typically used for local mDNS things not network-wide normal DNS lookups.
– Thomas Ward♦
Nov 16 at 15:50
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
the .local domain is used by avahi for its special services and i haven't been able to get other computers to use it over the network except when using mDNS applications.
You could run a proper dns server such as dnsmasq to achieve dns resolving of hostnames to ip addresses over a small network in addition to the /etc/hosts file.
To setup dnsmasq as your domain resolver choose another domain instead of .local. for example say .home or .house or anything other than .local. This domain works only on the network.
install dnsmasq onto the central "server". In this case your computer:
sudo apt install dnsmasq
Then setup dnsmasq:
sudo nano /etc/dnsmasq.conf
create a static file:
sudo rm /etc/resolv.conf
echo 'nameserver 127.0.0.1' | sudo tee /etc/resolv.conf
stop any instances of the services:
sudo killall dnsmasq
sudo service systemd-resolved stop
edit the dnsmasq conf:
sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.bak
sudo nano /etc/dnsmasq.conf
and add the following
#Beginning of configuration
domain-needed
bogus-priv
no-resolv
interface=wlp2s0
#Use below nameservers to reach the internet
server=8.8.8.8
server=8.8.4.4
#use below line to point to the router address.
#dhcp-option=option:router,192.168.0.50
#use two lines below to resolve local domains (eg .home)
local=/home/
domain=home
then restart dnsmasq:
sudo service dnsmasq restart
if you have a firewall remember to open ports 53, 67/udp, 68/udp, in the firewall
then edit the hosts file:
sudo nano /etc/hosts
and paste into it
. . .
127.0.0.1 localhost localhost.home
. . .
127.0.0.1 www.mysite1.home
127.0.0.1 mysite1.home
192.168.0.50 mysite1.home
192.168.0.50 mysite2.home
where 192.168.0.50 is the servers computer ip on the network and mysite.home are services that are listening on the server computer*
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
the .local domain is used by avahi for its special services and i haven't been able to get other computers to use it over the network except when using mDNS applications.
You could run a proper dns server such as dnsmasq to achieve dns resolving of hostnames to ip addresses over a small network in addition to the /etc/hosts file.
To setup dnsmasq as your domain resolver choose another domain instead of .local. for example say .home or .house or anything other than .local. This domain works only on the network.
install dnsmasq onto the central "server". In this case your computer:
sudo apt install dnsmasq
Then setup dnsmasq:
sudo nano /etc/dnsmasq.conf
create a static file:
sudo rm /etc/resolv.conf
echo 'nameserver 127.0.0.1' | sudo tee /etc/resolv.conf
stop any instances of the services:
sudo killall dnsmasq
sudo service systemd-resolved stop
edit the dnsmasq conf:
sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.bak
sudo nano /etc/dnsmasq.conf
and add the following
#Beginning of configuration
domain-needed
bogus-priv
no-resolv
interface=wlp2s0
#Use below nameservers to reach the internet
server=8.8.8.8
server=8.8.4.4
#use below line to point to the router address.
#dhcp-option=option:router,192.168.0.50
#use two lines below to resolve local domains (eg .home)
local=/home/
domain=home
then restart dnsmasq:
sudo service dnsmasq restart
if you have a firewall remember to open ports 53, 67/udp, 68/udp, in the firewall
then edit the hosts file:
sudo nano /etc/hosts
and paste into it
. . .
127.0.0.1 localhost localhost.home
. . .
127.0.0.1 www.mysite1.home
127.0.0.1 mysite1.home
192.168.0.50 mysite1.home
192.168.0.50 mysite2.home
where 192.168.0.50 is the servers computer ip on the network and mysite.home are services that are listening on the server computer*
add a comment |
up vote
1
down vote
the .local domain is used by avahi for its special services and i haven't been able to get other computers to use it over the network except when using mDNS applications.
You could run a proper dns server such as dnsmasq to achieve dns resolving of hostnames to ip addresses over a small network in addition to the /etc/hosts file.
To setup dnsmasq as your domain resolver choose another domain instead of .local. for example say .home or .house or anything other than .local. This domain works only on the network.
install dnsmasq onto the central "server". In this case your computer:
sudo apt install dnsmasq
Then setup dnsmasq:
sudo nano /etc/dnsmasq.conf
create a static file:
sudo rm /etc/resolv.conf
echo 'nameserver 127.0.0.1' | sudo tee /etc/resolv.conf
stop any instances of the services:
sudo killall dnsmasq
sudo service systemd-resolved stop
edit the dnsmasq conf:
sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.bak
sudo nano /etc/dnsmasq.conf
and add the following
#Beginning of configuration
domain-needed
bogus-priv
no-resolv
interface=wlp2s0
#Use below nameservers to reach the internet
server=8.8.8.8
server=8.8.4.4
#use below line to point to the router address.
#dhcp-option=option:router,192.168.0.50
#use two lines below to resolve local domains (eg .home)
local=/home/
domain=home
then restart dnsmasq:
sudo service dnsmasq restart
if you have a firewall remember to open ports 53, 67/udp, 68/udp, in the firewall
then edit the hosts file:
sudo nano /etc/hosts
and paste into it
. . .
127.0.0.1 localhost localhost.home
. . .
127.0.0.1 www.mysite1.home
127.0.0.1 mysite1.home
192.168.0.50 mysite1.home
192.168.0.50 mysite2.home
where 192.168.0.50 is the servers computer ip on the network and mysite.home are services that are listening on the server computer*
add a comment |
up vote
1
down vote
up vote
1
down vote
the .local domain is used by avahi for its special services and i haven't been able to get other computers to use it over the network except when using mDNS applications.
You could run a proper dns server such as dnsmasq to achieve dns resolving of hostnames to ip addresses over a small network in addition to the /etc/hosts file.
To setup dnsmasq as your domain resolver choose another domain instead of .local. for example say .home or .house or anything other than .local. This domain works only on the network.
install dnsmasq onto the central "server". In this case your computer:
sudo apt install dnsmasq
Then setup dnsmasq:
sudo nano /etc/dnsmasq.conf
create a static file:
sudo rm /etc/resolv.conf
echo 'nameserver 127.0.0.1' | sudo tee /etc/resolv.conf
stop any instances of the services:
sudo killall dnsmasq
sudo service systemd-resolved stop
edit the dnsmasq conf:
sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.bak
sudo nano /etc/dnsmasq.conf
and add the following
#Beginning of configuration
domain-needed
bogus-priv
no-resolv
interface=wlp2s0
#Use below nameservers to reach the internet
server=8.8.8.8
server=8.8.4.4
#use below line to point to the router address.
#dhcp-option=option:router,192.168.0.50
#use two lines below to resolve local domains (eg .home)
local=/home/
domain=home
then restart dnsmasq:
sudo service dnsmasq restart
if you have a firewall remember to open ports 53, 67/udp, 68/udp, in the firewall
then edit the hosts file:
sudo nano /etc/hosts
and paste into it
. . .
127.0.0.1 localhost localhost.home
. . .
127.0.0.1 www.mysite1.home
127.0.0.1 mysite1.home
192.168.0.50 mysite1.home
192.168.0.50 mysite2.home
where 192.168.0.50 is the servers computer ip on the network and mysite.home are services that are listening on the server computer*
the .local domain is used by avahi for its special services and i haven't been able to get other computers to use it over the network except when using mDNS applications.
You could run a proper dns server such as dnsmasq to achieve dns resolving of hostnames to ip addresses over a small network in addition to the /etc/hosts file.
To setup dnsmasq as your domain resolver choose another domain instead of .local. for example say .home or .house or anything other than .local. This domain works only on the network.
install dnsmasq onto the central "server". In this case your computer:
sudo apt install dnsmasq
Then setup dnsmasq:
sudo nano /etc/dnsmasq.conf
create a static file:
sudo rm /etc/resolv.conf
echo 'nameserver 127.0.0.1' | sudo tee /etc/resolv.conf
stop any instances of the services:
sudo killall dnsmasq
sudo service systemd-resolved stop
edit the dnsmasq conf:
sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.bak
sudo nano /etc/dnsmasq.conf
and add the following
#Beginning of configuration
domain-needed
bogus-priv
no-resolv
interface=wlp2s0
#Use below nameservers to reach the internet
server=8.8.8.8
server=8.8.4.4
#use below line to point to the router address.
#dhcp-option=option:router,192.168.0.50
#use two lines below to resolve local domains (eg .home)
local=/home/
domain=home
then restart dnsmasq:
sudo service dnsmasq restart
if you have a firewall remember to open ports 53, 67/udp, 68/udp, in the firewall
then edit the hosts file:
sudo nano /etc/hosts
and paste into it
. . .
127.0.0.1 localhost localhost.home
. . .
127.0.0.1 www.mysite1.home
127.0.0.1 mysite1.home
192.168.0.50 mysite1.home
192.168.0.50 mysite2.home
where 192.168.0.50 is the servers computer ip on the network and mysite.home are services that are listening on the server computer*
edited 21 hours ago
Rafael Muynarsk
485518
485518
answered yesterday
ptetteh227
890118
890118
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1092727%2fhow-can-i-create-a-local-dns-that-is-seen-from-other-computers-on-my-local-netwo%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
have you tried adding
machine-network-ip myhostname
in /etc/hosts in addition to127.0.0.1 myhostname
?– ptetteh227
Nov 14 at 10:27
@ptetteh227 I've tried that just now and rebooted the computer... But the DNS is still only available from my computer.
– Rafael Muynarsk
Nov 14 at 10:59
avoid using .local and use say .home. how many computers form the network?. If there are few computers you could manually enter into each machine's hosts file the
machine-network-ip hostname.home
of the other pc on the network. but if there are lots of computers consider dnsmasq.– ptetteh227
Nov 14 at 16:15
Keep in mind there isn't a DNS 'server' running open to the world on your computer by default. Avahi-Daemon is typically used for local mDNS things not network-wide normal DNS lookups.
– Thomas Ward♦
Nov 16 at 15:50