You are not logged in.
This is only a minor problem as I can access that dnsmasq-Server anytime by its IP, but anyway, I would be interested in knowing a solution for that:
I have a dnsmasq server with the hostname "server". When I try to access it by ssh by a computer using that DNS, the following happens:
ssh server
ssh: connect to host server port 22: Invalid argument
It's clear why that happens: Trying to ping server shows:
ping server
64 bytes from localhost.localdomain (127.0.0.1) ...
and that because of the /etc/hosts file of server:
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost server
....
and as /etc/hosts is parsed by dnsmqasq, dnsmasq tells that "server" has 127.0.0.1.
So the analysis of the problem is clear, but what is the solution? (apart from accessing the dnsmasq Server by its IP, which is more typing...)
As far as I understand, I can't leave out that line in /etc/hosts , can I?
Last edited by Carl Karl (2014-05-13 05:56:19)
Offline
Simply try adding the actual ip of the server to your /etc/hosts file. So that would become something among the lines of (replace 10.0.0.1 with the correct ip obviously):
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost server
10.0.0.1 server
Burninate!
Offline
@ Gcool
same hostname cannot be assigned to multiple ips. I just tested it, and the one that appears at the start of the file takes precedence.
Offline
At least you can put it in the /etc/hosts of the computer you run the ssh client on. Good enough, as long as the number of clients is finite. ;-)
Also, it is possible to assign a second name for that server in its hosts file.
Both are good enough for me, thanks. :-)
Offline
This needs to be done in the dnsmsaq service itself. http://wiki.openwrt.org/doc/howto/dhcp.dnsmasq?s[]=dns&s[]=hostname#configuring.dnsmasq.to.associate.client.hostnames.with.dhcp-supplied.ip.addresses It is for openwrt, but the configuration in the example uses the dnsmasq.conf file rather than the uci interface/configs, so it should apply to whatever you are running dnsmasq on.
Edit: Sorry, the forums don't like the square brackets in the url and I don't feel like figuring out how fix it.
Last edited by WonderWoofy (2014-05-13 22:35:34)
Offline