]> git.proxmox.com Git - pve-container.git/commitdiff
add fqdn to /etc/hosts even with no ip
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 29 Jun 2018 08:05:44 +0000 (10:05 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 22 Aug 2018 09:43:37 +0000 (11:43 +0200)
so that if a container is set to dhcp, it still has its
fqdn set correctly

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/PVE/LXC/Setup/Base.pm
src/test/test-debian-001/etc/hosts.exp
src/test/test-debian-003/etc/hosts.exp
src/test/test-debian-005/etc/hosts.exp
src/test/test-debian-007/etc/hosts.exp
src/test/test-debian-009/etc/hosts.exp
src/test/test-debian-010/etc/hosts.exp

index 2b777adb17a89f8a2037f087588f10a05660d422..2fd04ac9cb5256f2fc04fec8822844ebd59459dc 100644 (file)
@@ -90,6 +90,8 @@ sub update_etc_hosts {
 
     if (defined($hostip)) {
        $section .= "$hostip $all_names\n";
+    } elsif ($namepart ne 'localhost') {
+       $section .= "127.0.1.1 $all_names\n";
     } else {
        $section .= "127.0.1.1 $namepart\n";
     }
index c0dd46e0b6914789f0108e0a105b1812b6be96bc..c32502bb9286152947610a33a5f5160e1f55f821 100644 (file)
@@ -1,5 +1,5 @@
 # --- BEGIN PVE ---
 127.0.0.1 localhost.localnet localhost
 ::1 localhost.localnet localhost
-127.0.1.1 test1
+127.0.1.1 test1.proxmox.com test1
 # --- END PVE ---
index 3f85d3f32075ed1a2ba040ffa54f622c35fa5fe2..b0c50ead57ee3aa9230e4f525b0fff5543119c41 100644 (file)
@@ -1,5 +1,5 @@
 # --- BEGIN PVE ---
 127.0.0.1 localhost.localnet localhost
 ::1 localhost.localnet localhost
-127.0.1.1 test3
+127.0.1.1 test3.proxmox.com test3
 # --- END PVE ---
index c0dd46e0b6914789f0108e0a105b1812b6be96bc..c32502bb9286152947610a33a5f5160e1f55f821 100644 (file)
@@ -1,5 +1,5 @@
 # --- BEGIN PVE ---
 127.0.0.1 localhost.localnet localhost
 ::1 localhost.localnet localhost
-127.0.1.1 test1
+127.0.1.1 test1.proxmox.com test1
 # --- END PVE ---
index c0dd46e0b6914789f0108e0a105b1812b6be96bc..c32502bb9286152947610a33a5f5160e1f55f821 100644 (file)
@@ -1,5 +1,5 @@
 # --- BEGIN PVE ---
 127.0.0.1 localhost.localnet localhost
 ::1 localhost.localnet localhost
-127.0.1.1 test1
+127.0.1.1 test1.proxmox.com test1
 # --- END PVE ---
index ac7ee16f52f545b81e9217c7a215f282445e525d..d9b20b6a30cff2471316b2cf6dbc7d528a52979a 100644 (file)
@@ -1,5 +1,5 @@
 # --- BEGIN PVE ---
 127.0.0.1 localhost.localnet localhost
 ::1 localhost.localnet localhost
-127.0.1.1 test9
+127.0.1.1 test9.proxmox.com test9
 # --- END PVE ---
index e540d5a1cc7bcc64857c74b0572a547f88c56fb3..98ec0d306e27c88299d0969ab54b3b0c78fbdd3f 100644 (file)
@@ -1,5 +1,5 @@
 # --- BEGIN PVE ---
 127.0.0.1 localhost.localnet localhost
 ::1 localhost.localnet localhost
-127.0.1.1 test10
+127.0.1.1 test10.proxmox.com test10
 # --- END PVE ---