LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-22-2017, 04:07 PM   #1
toothandnail
Member
 
Registered: Apr 2007
Location: Oxfordshire, UK
Distribution: Arch, Sparky, Salix64
Posts: 119

Rep: Reputation: 25
Problems with dnsmasq under Ubuntu server 16.04


For the last several years, I've run dnsmasq on a small server to give me DHCP and DNS on my local network. The original server was Slackware-based and worked well. My server was in need of some hardware attention and I wanted to move it onto Ubuntu server (which I'm supporting for a couple of customers). While preparing the old server, I installed Ubuntu server 16.04 on a test box and set about configuring it to provide DHCP/DNS while the other server was being rebuilt.

I had some initial problems getting things set up (the Ubuntu server uses resolvconf, which got in the way initially). Got it working and pulled the original box to be rebuilt. I've now completed the hardware build and installed the latest Ubuntu server on it. I set up dnsmasq in the same way as I had set it up on the test box. Looked good - DHCP and DNS servers both working fine for the local network, everything looked good. Well, initially...

I've now found that if I attempt to SSH into the new server by name, I get permission denied. I've got SSH login set up for paired keys only, and the keys haven't changed. If I ssh in using the new server's IP, things work just as they should.

I've done an nmap scan on the network from the new server and I notice that while the other machines on the network are all resolved by name, the new server is only displayed by IP. It looks as though for some reason, it doesn't know its own name.

The configuration I'm using is quite simple (don't have terribly complex needs), but I've obviously got something set incorrectly.

/etc/dnsmasq.conf is as follows:

Code:
# Configuration file for dnsmasq.

domain-needed
bogus-priv
#resolv-file=/etc/nameserver.list
local=/ibmpeers.net/
domain=ibmpeers.net
expand-hosts
dhcp-range=192.168.1.100,192.168.1.200,12h

dhcp-host=00:01:d2:04:0b:d8,openwrt,192.168.1.92
dhcp-host=00:14:BF:70:9B:36,slug,192.168.1.91
dhcp-host=B8:27:EB:CE:03:4C,b2,192.168.1.90
dhcp-host=D8:5D:E2:6B:CE:BE,BRWD85DE26BCEBE,192.168.1.93
dhcp-host=28:32:c5:ae:d4:e4,humax,192.168.1.94
dhcp-host=50:f5:da:d4:a8:ef,Firestick,192.168.1.95

#listen-address=127.0.0.1
dhcp-option=option:router,192.168.1.254

dhcp-option=vendor:MSFT,2,1i
dhcp-authoritative
/etc/network/interfaces:

Code:
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto enp2s0
iface enp2s0 inet static
address 192.168.1.250
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.254
dns-nameservers 8.8.8.8 8.8.4.4 192.168.1.254
dns-search ibmpeers.net
I've also configured resolveconf using /etc/resolvconf/resolv.conf.d/base to add external nameservers:

Code:
nameserver 8.8.8.8
nameserver 8.8.4.4
This is essentially the same configuration I used on the test box, which is not showing this problem. I'm hoping someone can point out what I've missed in setting dnsmasq up under Ubuntu...
 
Old 05-22-2017, 04:23 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Did you put the server in its own hosts file?
 
Old 05-22-2017, 04:26 PM   #3
toothandnail
Member
 
Registered: Apr 2007
Location: Oxfordshire, UK
Distribution: Arch, Sparky, Salix64
Posts: 119

Original Poster
Rep: Reputation: 25
Quote:
Originally Posted by michaelk View Post
Did you put the server in its own hosts file?
Yeah. As below:

Code:
127.0.0.1	localhost
127.0.1.1	tarus.ibmpeers.net	tarus

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
 
Old 05-22-2017, 04:34 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Try adding 192.168.1.250 and be sure to restart dnsmasq.
 
1 members found this post helpful.
Old 05-22-2017, 04:52 PM   #5
toothandnail
Member
 
Registered: Apr 2007
Location: Oxfordshire, UK
Distribution: Arch, Sparky, Salix64
Posts: 119

Original Poster
Rep: Reputation: 25
Smile

Quote:
Originally Posted by michaelk View Post
Try adding 192.168.1.250 and be sure to restart dnsmasq.

That was it! Thanks, just what the doctor ordered
 
Old 05-22-2017, 05:05 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Good.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to use wildcards in dnsmasq server entries? MikeyCarter Linux - Software 1 06-28-2013 05:02 AM
dnsmasq - so what is my dns server? eantoranz Linux - Networking 16 01-26-2013 09:23 PM
How to diagnose dnsmasq problems? catkin Linux - Software 0 05-31-2012 02:04 AM
[SOLVED] DCHP Server or dnsmasq?? tr1pl3x Linux - Newbie 1 07-16-2010 12:25 AM
DNSMASQ has problems with 'resolv.conf' Ashrack Linux - Networking 5 07-03-2006 01:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration