[Dnsmasq-discuss] Dynamic address config?
Erik Edwards
erik at emedwards.info
Sat Nov 26 15:11:28 UTC 2022
Another option would be running BIND on an alternate socket, use
nsupdate to add the addresses.
DNSMASQ to redirect *.mylab to the BIND instance or BIND can be run in
authoritative (for tld: "mylab.") & access restricted recursing on
socket 53.
On 11/26/22 07:55, Geoff Back wrote:
> Hello,
>
> How about adding:
>
> alias labssh='ssh -i ~/.ssh/id_rsa.work'
>
> to your shell profile (.bashrc or whatever)? Then you can just do
> 'labssh <ip-address>' and the alias expansion makes ssh use the
> appropriate ID file.
>
> Regards,
>
> Geoff.
>
> Geoff Back
> What if we're all just characters in someone's nightmares?
> On 26/11/2022 13:14, Feng Shao wrote:
>> Thanks for the reply Petr.
>> Let me explain more about the motivation: I am a developer and our
>> testers test the code on various environments, including VMs on cloud
>> and k8s worker nodes from cloud providers. These machines and IPs are
>> not provisioned/allocated by dnsmasq. For cost reason, these
>> environments only lives for a short period of time, like one week or
>> so, and testers provision these IPs directly without awareness of
>> network administrators, that’s also why we don’t configure hostname
>> for these machines in DNS system. Also I can not know in advance the
>> list of possible IPs.
>>
>> Whenever tester find some issue or need help, they give me the IP of
>> the environments and I need to ssh to that environment. Because I
>> will probably login to that same machine several times since the
>> testers are testing my code on that machine recently, I want to setup
>> passwordless login. So I normally ssh-copy-id -i <~/.ssh/id_rsa.work
>> <http://id_rsa.work>> <IP>first, then ssh to that machine. In order
>> to instruct ssh to use my ssh key when connecting to that IP, I have
>> below lines in my .ssh/config:
>>
>> Host *.mylab
>> User root
>> IdentityFile ~/.ssh/id_rsa.wor <http://id_rsa.work/>k
>>
>> And lines like below in /etc/hosts:
>> address=/123.123.123.123
>> <http://123.123.123.123>.mylab/123.123.123.123 <http://123.123.123.123/>
>> address=/123.123.123.12
>> <http://123.123.123.123>4.mylab/123.123.123.12 <http://123.123.123.123/>4
>>
>> So that I can now “ssh 123.123.123.123.mylab”
>>
>> As you can see, the problem here is, whenever a new IP comes, I need
>> to add a new entry in /etc/hosts. So what I want is any <IP>.mylab is
>> resolved to <IP>.
>>
>> A key pair can be specified when creating VM on cloud, but I can not
>> ask every tester add my ssh key pair when creating VM.
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20221126/a9948059/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20221126/a9948059/attachment.sig>
More information about the Dnsmasq-discuss
mailing list