DNS lookup for LXC container after restart

,

Hi,

I have opensuse lxc container with hostname krtko. I can use krtko or krtko.lan DNS name. But after lxc-stop -r -n opensuse I get:

hlavki@hlknb:~> nslookup krtko.lan
Server:         192.168.10.1
Address:        192.168.10.1#53

** server can't find krtko.lan: NXDOMAIN

But when I restart resolver /etc/init.d/resolver restart krtko is back:

hlavki@hlknb:~> nslookup krtko.lan
Server:         192.168.10.1
Address:        192.168.10.1#53

Non-authoritative answer:
Name:   krtko.lan
Address: 192.168.10.128
** server can't find krtko.lan: NXDOMAIN

Is this expected behaviour or bug? thanks

This name is based on its dynamic DHCP lease (I presume that’s how you set it up). I suspect that shutting the container will make the lease end in some way.

Yes, the only thing I did was set name in /etc/hostname.

Anyway it should make lease start on startup.

The names are harvested once in ten minutes IIRC.

thanks @vcunat, that makes sense.