summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/command.c3
-rw-r--r--vtysh/vtysh_config.c5
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/command.c b/lib/command.c
index d17f2c3d48..6870f4804b 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -500,6 +500,9 @@ static int config_write_host(struct vty *vty)
if (cmd_hostname_get())
vty_out(vty, "hostname %s\n", cmd_hostname_get());
+ if (cmd_domainname_get())
+ vty_out(vty, "domainname %s\n", cmd_domainname_get());
+
if (host.encrypt) {
if (host.password_encrypt)
vty_out(vty, "password 8 %s\n", host.password_encrypt);
diff --git a/vtysh/vtysh_config.c b/vtysh/vtysh_config.c
index 967f855fbc..5ba749e66f 100644
--- a/vtysh/vtysh_config.c
+++ b/vtysh/vtysh_config.c
@@ -448,6 +448,11 @@ void vtysh_config_write()
sprintf(line, "hostname %s", cmd_hostname_get());
vtysh_config_parse_line(NULL, line);
}
+
+ if (cmd_domainname_get()) {
+ sprintf(line, "domainname %s", cmd_domainname_get());
+ vtysh_config_parse_line(NULL, line);
+ }
if (vtysh_write_integrated == WRITE_INTEGRATED_NO)
vtysh_config_parse_line(NULL,
"no service integrated-vtysh-config");