Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #166812 > unrolled thread
| Started by | Dan Hitt <dan.hitt@gmail.com> |
|---|---|
| First post | 2016-04-17 07:20 +0200 |
| Last post | 2016-04-17 22:00 +0200 |
| Articles | 9 — 3 participants |
Back to article view | Back to linux.debian.user
searching for hosts in domain local Dan Hitt <dan.hitt@gmail.com> - 2016-04-17 07:20 +0200
Re: searching for hosts in domain local Andy Smith <andy@strugglers.net> - 2016-04-17 07:50 +0200
Re: searching for hosts in domain local Andy Smith <andy@strugglers.net> - 2016-04-17 13:00 +0200
Re: searching for hosts in domain local Dan Hitt <dan.hitt@gmail.com> - 2016-04-17 18:50 +0200
Re: searching for hosts in domain local David Wright <deblis@lionunicorn.co.uk> - 2016-04-17 22:40 +0200
Re: searching for hosts in domain local Dan Hitt <dan.hitt@gmail.com> - 2016-04-18 03:40 +0200
Re: searching for hosts in domain local Dan Hitt <dan.hitt@gmail.com> - 2016-04-17 14:40 +0200
Re: searching for hosts in domain local David Wright <deblis@lionunicorn.co.uk> - 2016-04-17 22:20 +0200
Re: searching for hosts in domain local David Wright <deblis@lionunicorn.co.uk> - 2016-04-17 22:00 +0200
| From | Dan Hitt <dan.hitt@gmail.com> |
|---|---|
| Date | 2016-04-17 07:20 +0200 |
| Subject | searching for hosts in domain local |
| Message-ID | <roNhL-7uX-1@gated-at.bofh.it> |
In my local network, the machines generally know each other by names like
first_host.local
second_host.local
third_host.local
...
So if i'm on first_host, i can ssh to second_host with
ssh my_account@second_host.local
and i can ping second_host by
ping second_host.local
I would like to drop the '.local' because it's an extra six characters
with absolutely no value.
In principle, i think it should be possible to by just adding
search local
to my /etc/resolv.conf, but this absolutely does not work. (I imagine that
local is a really magic name in some contexts but not very magic in others.)
Furthermore, /etc/resolv.conf doesn't want to be written, as it
says it is generated automatically, so even if it worked, it wouldn't
be such a good solution.
I can sort of fix the situation by editing ~/.ssh/config and adding lines
Host second_host
Hostname second_host.local
but this has the disadvantage that i have to do it for every host on
the network, and it only affects ssh --- ping and presumably every
other command (naturally!) do not consult this file.
(I don't have any influence over my router which comes from
my service provider, but i wouldn't want to change it even if
i could, since i'm just asking my own machine to intercept
a name like second_host and convert it to second_host.local
before processing further.)
Thanks in advance for any clues or references to man pages
or even other mailing lists.
dan
[toc] | [next] | [standalone]
| From | Andy Smith <andy@strugglers.net> |
|---|---|
| Date | 2016-04-17 07:50 +0200 |
| Message-ID | <roNKO-7JO-11@gated-at.bofh.it> |
| In reply to | #166812 |
Hi Dan, On Sat, Apr 16, 2016 at 10:14:29PM -0700, Dan Hitt wrote: > I would like to drop the '.local' because it's an extra six characters > with absolutely no value. > > In principle, i think it should be possible to by just adding > search local > to my /etc/resolv.conf, but this absolutely does not work. (I imagine that > local is a really magic name in some contexts but not very magic in others.) You may need to use "local." with a dot at the end. What doesn't work about it? ".local" TLD is kind of special so you may find problems anyway - it's used for multicast DNS (Avahi). You may be better off picking a different domain for your local network. > Furthermore, /etc/resolv.conf doesn't want to be written, as it > says it is generated automatically, so even if it worked, it wouldn't > be such a good solution. You can override the domain search list that your DHCP server provides by editing /etc/dhcp/dhclient.conf and putting in either: supersede domain-name "local." or: prepend domain-name "local." or: append domain-name "local." Depending upon whether you want to have *only* your search domains, your search domains *first*, or your search domains *last*, respectively. See man dhclient.conf for more info. Cheers, Andy -- http://bitfolk.com/ -- No-nonsense VPS hosting
[toc] | [prev] | [next] | [standalone]
| From | Andy Smith <andy@strugglers.net> |
|---|---|
| Date | 2016-04-17 13:00 +0200 |
| Message-ID | <roSAO-2WB-5@gated-at.bofh.it> |
| In reply to | #166813 |
Hi Dan,
On Sat, Apr 16, 2016 at 11:56:11PM -0700, Dan Hitt wrote:
> On Sat, Apr 16, 2016 at 10:42 PM, Andy Smith <andy@strugglers.net> wrote:
> > What doesn't work about it?
>
> It has no effect.
>
> So, if i do
> ping second_host
> i get "unknown host" from ping.
OK. So all the hosts on your local network are getting .local as a
domain name by suggestion of the DHCP server, but do you have a DNS
server anywhere that is serving those names, or are you putting
everything in /etc/hosts?
I have done some tests on my own machines and I find that if I add
"local." to my search line in /etc/resolv.conf it does seem to
generate a DNS query for whatever.local. I do not have a DNS server
that is serving the .local zone though, so it gives me NXDOMAIN. Of
course if I would add google.com to my search list then a query for
say, "mail" would turn into "mail.google.com" and I'd get an answer.
So I wonder how your DNS is set up.
If you are relying on the ISP-supplied router to serve DNS for names
it is giving out by DHCP, well, some would and some wouldn't. You
could check by running DNS diagnostic tools such as "dig" against
the IP address of your router, e.g.:
dig -t a second-host.local @192.168.0.1
where "second-host.local" is what you want to look up, "192.168.0.1"
is the IP address of your router and the "-t a" is asking for
answers of type A: IPv4 address. If that gave an NXDOMAIN answer
then there isn't any configuration mistake on your side, it's just
that your router is not acting as a DNS server for that zone.
(By the way, underscores are not permitted in Internet host names,
so your "first_host" and "second_host" examples are not good, but I
am guessing they were merely examples.)
> Given this, is there any way to change the network's name?
Although .local is reserved for mDNS, I think that unless you
actually use mDNS you should be okay. As I say, I put ".local" in my
search list and then saw DNS queries going out for those names so it
probably doesn't interfere with (normal, unicast) DNS.
> Is there any way to reload the dhclient.conf file without restarting dhclient?
These settings only take effect when you get a new lease or renew an
existing one. So I think the answer is no. Is getting a new lease
problematic? Normally on a DHCP network you don't tend to care if
your IP address changes… (if you do care, you can get the DHCP
server to give you the same one each time, but in your case that'd
be a setting in the router which you don't manage).
> This seems perplexing to me, because i'm not unhappy with any of the
> ips i'm getting, i just want to be able to refer to hosts by shorter names.
The issue is that these are different concepts and different
services here, although they seem related and in your case are being
provided by the same black box. The black box tells you your IP
address and your host name and your domain name, so it seems logical
that it should be able to also serve DNS for that zone, but it is
not always the case.
Cheers,
Andy
--
http://bitfolk.com/ -- No-nonsense VPS hosting
[toc] | [prev] | [next] | [standalone]
| From | Dan Hitt <dan.hitt@gmail.com> |
|---|---|
| Date | 2016-04-17 18:50 +0200 |
| Message-ID | <roY3x-7op-29@gated-at.bofh.it> |
| In reply to | #166816 |
Andy --- thanks for all your help in diagnosing my situation and educating me!
This includes facts like the nature of these names (second_host was
indeed an example, did not know about the restriction on the names) and
use of dig.
I did some more experimentation on my system, and in fact my other
linux machine (which i'll just call 'secondhost', since 'second_host'
is illegitimate)
has no problems dropping the '.local', for ping and ssh.
And there is a difference between the two machines, which i didn't
think was important, but it must be. I.e., i think i've been
concealing evidence :(
My main machine ('firsthost') also connects to a little switch (via a
usb-to-ethernet
adapter) where two other machines are. These other machines are really
allergic to my router so cannot be plugged in directly to it. (I was amazed
at how easy it was to do this, the network manager on my main linux
machine had a little gui that offered to 'share the network' and it
all just worked.)
None of the names for any of the machines are served.
Now, just for reference, since you were so nice to answer all these questions:
My second linux machine is NXDOMAIN accourding to dig -t a, and that's
also the case for the two hypersensitive machines hiding behind my
main linux machine.
I haven't written anything in any /etc/hosts file anywhere, so the machines
all know each others ips in some other way.
If there's a way to determine if i'm running mDNS on my main linux
machine i'm certainly interested, but i don't want to be too greedy about this.
Because, after all, maybe it is reasonable that if my main linux
machine is sending all these packets around it needs more help
in determining what's on the local network.
If i get to the point where all my hardware is running free software
i may get greedier. :)
Thanks again for all your help!!
dan
On Sun, Apr 17, 2016 at 2:19 AM, Andy Smith <andy@strugglers.net> wrote:
> Hi Dan,
>
> On Sat, Apr 16, 2016 at 11:56:11PM -0700, Dan Hitt wrote:
>> On Sat, Apr 16, 2016 at 10:42 PM, Andy Smith <andy@strugglers.net> wrote:
>> > What doesn't work about it?
>>
>> It has no effect.
>>
>> So, if i do
>> ping second_host
>> i get "unknown host" from ping.
>
> OK. So all the hosts on your local network are getting .local as a
> domain name by suggestion of the DHCP server, but do you have a DNS
> server anywhere that is serving those names, or are you putting
> everything in /etc/hosts?
>
> I have done some tests on my own machines and I find that if I add
> "local." to my search line in /etc/resolv.conf it does seem to
> generate a DNS query for whatever.local. I do not have a DNS server
> that is serving the .local zone though, so it gives me NXDOMAIN. Of
> course if I would add google.com to my search list then a query for
> say, "mail" would turn into "mail.google.com" and I'd get an answer.
>
> So I wonder how your DNS is set up.
>
> If you are relying on the ISP-supplied router to serve DNS for names
> it is giving out by DHCP, well, some would and some wouldn't. You
> could check by running DNS diagnostic tools such as "dig" against
> the IP address of your router, e.g.:
>
> dig -t a second-host.local @192.168.0.1
>
> where "second-host.local" is what you want to look up, "192.168.0.1"
> is the IP address of your router and the "-t a" is asking for
> answers of type A: IPv4 address. If that gave an NXDOMAIN answer
> then there isn't any configuration mistake on your side, it's just
> that your router is not acting as a DNS server for that zone.
>
> (By the way, underscores are not permitted in Internet host names,
> so your "first_host" and "second_host" examples are not good, but I
> am guessing they were merely examples.)
>
>> Given this, is there any way to change the network's name?
>
> Although .local is reserved for mDNS, I think that unless you
> actually use mDNS you should be okay. As I say, I put ".local" in my
> search list and then saw DNS queries going out for those names so it
> probably doesn't interfere with (normal, unicast) DNS.
>
>> Is there any way to reload the dhclient.conf file without restarting dhclient?
>
> These settings only take effect when you get a new lease or renew an
> existing one. So I think the answer is no. Is getting a new lease
> problematic? Normally on a DHCP network you don't tend to care if
> your IP address changes… (if you do care, you can get the DHCP
> server to give you the same one each time, but in your case that'd
> be a setting in the router which you don't manage).
>
>> This seems perplexing to me, because i'm not unhappy with any of the
>> ips i'm getting, i just want to be able to refer to hosts by shorter names.
>
> The issue is that these are different concepts and different
> services here, although they seem related and in your case are being
> provided by the same black box. The black box tells you your IP
> address and your host name and your domain name, so it seems logical
> that it should be able to also serve DNS for that zone, but it is
> not always the case.
>
> Cheers,
> Andy
>
> --
> http://bitfolk.com/ -- No-nonsense VPS hosting
[toc] | [prev] | [next] | [standalone]
| From | David Wright <deblis@lionunicorn.co.uk> |
|---|---|
| Date | 2016-04-17 22:40 +0200 |
| Message-ID | <rp1E6-1Gt-11@gated-at.bofh.it> |
| In reply to | #166842 |
On Sun 17 Apr 2016 at 09:42:38 (-0700), Dan Hitt wrote: > If there's a way to determine if i'm running mDNS on my main linux > machine i'm certainly interested, but i don't want to be too greedy about this. > Because, after all, maybe it is reasonable that if my main linux > machine is sending all these packets around it needs more help > in determining what's on the local network. $ grep -i mdns /etc/services mdns 5353/tcp # Multicast DNS mdns 5353/udp $ netstat -n -a -e | grep 5353 udp 0 0 0.0.0.0:5353 0.0.0.0:* 103 14857 udp6 0 0 :::5353 :::* 103 14858 $ Cheers, David.
[toc] | [prev] | [next] | [standalone]
| From | Dan Hitt <dan.hitt@gmail.com> |
|---|---|
| Date | 2016-04-18 03:40 +0200 |
| Message-ID | <rp6kq-5ph-5@gated-at.bofh.it> |
| In reply to | #166846 |
Hi David, Thanks for your responses. I'm going to try to your questions and points all in this one post so it's easier to comprehend. Regarding the 'local' name, i don't know how it came into being (or whether it was deliberate on anybody's part). I sure don't think i created it. Thanks for pointing out /var/lib/dhcp/, and thanks very much for pointing out netstat. My /etc/services is like yours regarding mdns (no surprise there i guess), and also like yours regarding what netstat reveals: udp and udp6 for 5353 so something is trying to use that port. I've subsequently set up ~/.ssh/config so i can ssh to all my machines without '.local'. I don't ping too much, so that's not a problem (but it is a little unsatisfactory). And --- i was wrong about how i have my network laid out. So if anybody stumbles on this thread with a similar problem: The router just connects directly to my main linux machine, and the other three hosts (one linux, two other) are all on a subnet that does not include the router. So their behavior is much more plausible --- they don't need '.local' at all --- the only machine that seems to need '.local' is my main linux machine, but it has two network interfaces, so it's in a unique situation. (And that's why i don't want to be too emphatic about 'local' --- i sure don't think i chose that word, but because i was wrong about describing my network earlier, maybe i did something else and just don't recall it. For example, if 'local' was a drop down in one of the guis i went through, then that might be the origin. And i'm very sorry for leaving a trail of red herrings if so!!! :( ) dan On Sun, Apr 17, 2016 at 1:37 PM, David Wright <deblis@lionunicorn.co.uk> wrote: > On Sun 17 Apr 2016 at 09:42:38 (-0700), Dan Hitt wrote: >> If there's a way to determine if i'm running mDNS on my main linux >> machine i'm certainly interested, but i don't want to be too greedy about this. >> Because, after all, maybe it is reasonable that if my main linux >> machine is sending all these packets around it needs more help >> in determining what's on the local network. > > $ grep -i mdns /etc/services > mdns 5353/tcp # Multicast DNS > mdns 5353/udp > $ netstat -n -a -e | grep 5353 > udp 0 0 0.0.0.0:5353 0.0.0.0:* 103 14857 > udp6 0 0 :::5353 :::* 103 14858 > $ > > Cheers, > David. >
[toc] | [prev] | [next] | [standalone]
| From | Dan Hitt <dan.hitt@gmail.com> |
|---|---|
| Date | 2016-04-17 14:40 +0200 |
| Message-ID | <roSAO-2WB-7@gated-at.bofh.it> |
| In reply to | #166813 |
Thanks Andy for your suggestions --- some answers and questions
interspersed below:
On Sat, Apr 16, 2016 at 10:42 PM, Andy Smith <andy@strugglers.net> wrote:
> Hi Dan,
>
> On Sat, Apr 16, 2016 at 10:14:29PM -0700, Dan Hitt wrote:
>> I would like to drop the '.local' because it's an extra six characters
>> with absolutely no value.
>>
>> In principle, i think it should be possible to by just adding
>> search local
>> to my /etc/resolv.conf, but this absolutely does not work. (I imagine that
>> local is a really magic name in some contexts but not very magic in others.)
>
> You may need to use "local." with a dot at the end.
>
> What doesn't work about it?
It has no effect.
So, if i do
ping second_host
i get "unknown host" from ping.
On the other hand, if i add something like
search google.com
then a command like
ping mail
really does work, and really does ping mail.google.com.
So i know that /etc/resolv.conf is being read and acted on, on every
invocation of ping, if i'm searching google.com, but if i'm searching
local, nothing whatsoever happens.
Further, "local." with a dot at the end, is no different (although i see
that it looks like you can add a dot to any host name, although
not two consecutive dots).
>
> ".local" TLD is kind of special so you may find problems anyway -
> it's used for multicast DNS (Avahi). You may be better off picking a
> different domain for your local network.
I didn't pick that name :)
And my router is a black box which i cannot touch.
Given this, is there any way to change the network's name?
>
>> Furthermore, /etc/resolv.conf doesn't want to be written, as it
>> says it is generated automatically, so even if it worked, it wouldn't
>> be such a good solution.
>
> You can override the domain search list that your DHCP server
> provides by editing /etc/dhcp/dhclient.conf and putting in either:
>
> supersede domain-name "local."
>
> or:
>
> prepend domain-name "local."
>
> or:
>
> append domain-name "local."
>
> Depending upon whether you want to have *only* your search domains,
> your search domains *first*, or your search domains *last*,
> respectively.
>
> See man dhclient.conf for more info.
This is very useful information.
Is there any way to reload the dhclient.conf file without restarting dhclient?
I don't want to get a new lease, just have an already running dhclient reread
the file. The man page for dhclient doesn't seem to indicate how you
can get the file reread without restarting dhclient and getting a new lease.
This seems perplexing to me, because i'm not unhappy with any of the
ips i'm getting, i just want to be able to refer to hosts by shorter names.
>
> Cheers,
> Andy
Thanks again for your help!!
dan
>
> --
> http://bitfolk.com/ -- No-nonsense VPS hosting
>
[toc] | [prev] | [next] | [standalone]
| From | David Wright <deblis@lionunicorn.co.uk> |
|---|---|
| Date | 2016-04-17 22:20 +0200 |
| Message-ID | <rp1kK-1xa-3@gated-at.bofh.it> |
| In reply to | #166827 |
On Sat 16 Apr 2016 at 23:56:11 (-0700), Dan Hitt wrote: > On Sat, Apr 16, 2016 at 10:42 PM, Andy Smith <andy@strugglers.net> wrote: > > ".local" TLD is kind of special so you may find problems anyway - > > it's used for multicast DNS (Avahi). You may be better off picking a > > different domain for your local network. > > I didn't pick that name :) So how did you come by it? > And my router is a black box which i cannot touch. Is it a wireless router? How do you set/change to password? > Is there any way to reload the dhclient.conf file without restarting dhclient? > I don't want to get a new lease, just have an already running dhclient reread > the file. The man page for dhclient doesn't seem to indicate how you > can get the file reread without restarting dhclient and getting a new lease. > This seems perplexing to me, because i'm not unhappy with any of the > ips i'm getting, i just want to be able to refer to hosts by shorter names. man dhclient on my systems says: "In order to keep track of leases across system reboots and server restarts, dhclient keeps a list of leases it has been assigned in the dhclient.leases file. On startup, after reading the dhclient.conf file, dhclient reads the dhclient.leases file to refresh its memory about what leases it has been assigned." (in /var/lib/dhcp/ of course.) Don't ask me what happens if you surreptitiously edit the appropriate line in that file and then restart your network (or reboot). Others may know. Cheers, David.
[toc] | [prev] | [next] | [standalone]
| From | David Wright <deblis@lionunicorn.co.uk> |
|---|---|
| Date | 2016-04-17 22:00 +0200 |
| Message-ID | <rp11o-19p-7@gated-at.bofh.it> |
| In reply to | #166812 |
On Sat 16 Apr 2016 at 22:14:29 (-0700), Dan Hitt wrote: > In my local network, the machines generally know each other by names like > first_host.local > second_host.local > third_host.local > ... > > So if i'm on first_host, i can ssh to second_host with > ssh my_account@second_host.local > and i can ping second_host by > ping second_host.local > > I would like to drop the '.local' because it's an extra six characters > with absolutely no value. > > In principle, i think it should be possible to by just adding > search local > to my /etc/resolv.conf, but this absolutely does not work. (I imagine that > local is a really magic name in some contexts but not very magic in others.) If your router is ISP-provided, it's probably cheap, therefore lacking a DNS server, so only routable domains can be looked up on your WAN nameserver. (Local isn't routable.) > Furthermore, /etc/resolv.conf doesn't want to be written, as it > says it is generated automatically, so even if it worked, it wouldn't > be such a good solution. > > I can sort of fix the situation by editing ~/.ssh/config and adding lines > Host second_host > Hostname second_host.local > but this has the disadvantage that i have to do it for every host on > the network, and it only affects ssh --- ping and presumably every > other command (naturally!) do not consult this file. > > (I don't have any influence over my router which comes from > my service provider, but i wouldn't want to change it even if > i could, since i'm just asking my own machine to intercept > a name like second_host and convert it to second_host.local > before processing further.) Obviously we don't know what sort of router you have. Does it have a range of addresses which is does not (or can be told not to) serve with DHCP? Can you deduce this range by seeing what IP addresses you *do* get served with? Eg, if all your hosts are 192.168.1.32, 192.168.1.33, 192.168.1.34,... then it's possible that configuring a machine as venus=192.168.1.12 will just *work*. In which case you can put all your hosts into /etc/hosts as static addresses, and leave the network name blank. Cheers, David.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.debian.user
csiph-web