summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/network/connection/ethernet.pm2
-rw-r--r--lib/network/netconnect.pm2
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/network/connection/ethernet.pm b/lib/network/connection/ethernet.pm
index 1722da7..d764f4d 100644
--- a/lib/network/connection/ethernet.pm
+++ b/lib/network/connection/ethernet.pm
@@ -209,6 +209,8 @@ sub guess_hostname_settings {
sub get_hostname_settings {
my ($self) = @_;
my $auto_hostname = sub { $self->{protocol} eq 'dhcp' && $self->{address}{needhostname} };
+ # configure the default hostname so the hostname setting should be more obvious to the users
+ $self->{address}{hostname} = 'localhost.localdomain' unless $self->{address}{hostname};
[
if_($self->{protocol} eq 'dhcp',
{ text => N("Assign host name from DHCP server (or generate a unique one)"), val => \$self->{address}{needhostname}, type => "bool" },
diff --git a/lib/network/netconnect.pm b/lib/network/netconnect.pm
index 895ed0a..e12caa2 100644
--- a/lib/network/netconnect.pm
+++ b/lib/network/netconnect.pm
@@ -265,8 +265,8 @@ If you do not know it, keep the preselected protocol.") },
pre => sub {
$address_settings = $connection->can('get_address_settings') && $connection->get_address_settings;
$connection->guess_address_settings if $connection->can('guess_address_settings');
- $hostname_settings = $connection->can('get_hostname_settings') && $connection->get_hostname_settings;
$connection->guess_hostname_settings if $connection->can('guess_hostname_settings');
+ $hostname_settings = $connection->can('get_hostname_settings') && $connection->get_hostname_settings;
},
name => sub { $net->{type}->get_type_name . "\n\n" . $connection->get_address_settings_label },
data => sub { [ @$address_settings, @$hostname_settings ] },