Local lan hostnames resolving

Hi

I am trying migrate from my OpenWRT router/firewall to VyOS 1.3 in virtual env. with vrrp configuration. Right now i am on to setup local hostnames resolving. But its not working. Under OpenWRT there is dnsmasq for this. How can i configure local hostnames resolving on VyOS ?

interfaces {
     ethernet eth0 {
         description WAN-PPPoE
     }
     ethernet eth1 {
         address 10.10.10.254/24
         description LAN
     }
     ethernet eth2 {
         address 10.11.11.254/24
         description LAN-GUEST
     }
     loopback lo {
     }
 }
 protocols {
     static {
         route 0.0.0.0/0 {
             next-hop 10.10.10.1 {
             }
         }
     }
 }
 service {
     dhcp-server {
         hostfile-update
         shared-network-name lan {
             domain-name lan
             domain-search lan
             ping-check
             subnet 10.10.10.0/24 {
                 default-router 10.10.10.1
                 description lan-subnet
                 name-server 10.10.10.254
                 name-server 10.10.10.253
                 range pool01 {
                     start 10.10.10.200
                     stop 10.10.10.240
                 }
                 static-mapping amaterasu {
                     ip-address 10.10.10.30
                     mac-address XXXXXXXXXXXX
                 }
                 static-mapping delta {
                     ip-address 10.10.10.50
                     mac-address XXXXXXXXXXXX
                 }
                 static-mapping deluge {
                     ip-address 10.10.10.101
                     mac-address XXXXXXXXXXXX
                 }
                 static-mapping gns3-vm {
                     ip-address 10.10.10.120
                     mac-address XXXXXXXXXXXX
                 }
                 static-mapping ikea-gw {
                     ip-address 10.10.10.51
                     mac-address XXXXXXXXXXXX
                 }
                 static-mapping izanagi {
                     ip-address 10.10.10.100
                     mac-address XXXXXXXXXXXX
                 }
                 static-mapping motu {
                     ip-address 10.10.10.202
                     mac-address XXXXXXXXXXXX
                 }
                 static-mapping ps5 {
                     ip-address 10.10.10.203
                     mac-address XXXXXXXXXXXX
                 }
                 static-mapping susanoo {
                     ip-address 10.10.10.201
                     mac-address XXXXXXXXXXXX
                 }
                 static-mapping wiki {
                     ip-address 10.10.10.103
                     mac-address XXXXXXXXXXXX
                 }
                 static-mapping yama-ap {
                     ip-address 10.10.10.3
                     mac-address XXXXXXXXXXXX
                 }
                 static-mapping yama-sw {
                     ip-address 10.10.10.2
                     mac-address XXXXXXXXXXXX
                 }
             }
         }
     }
     dns {
         forwarding {
             allow-from 10.0.0.0/8
             listen-address 10.10.10.254
             listen-address 10.11.11.254
             system
         }
     }



static-host-mapping {
         host-name yama01 {
             inet 10.10.10.254
         }
         host-name yama02 {
             inet 10.10.10.253
         }
         host-name yama-ap-second {
             inet 10.11.11.2
         }
     }

When i try nslookup for yama02 i get: can’t find yama02.lan: Non-existent domain for yama01 i get loopback adress 127.0.1.1

Any idea ?

You can try on latest 1.4 images. Here is a simple example:

vyos@vyos:~$ show config comm | grep dns
set service dns forwarding allow-from '192.168.99.0/24'
set service dns forwarding authoritative-domain example.com records a host66 address '192.0.2.66'
set service dns forwarding listen-address '192.168.99.1'

vyos@vyos:~$ show config comm | grep eth3
set interfaces ethernet eth3 address '192.168.99.1/24'

Then, on host located on LAN, in this case attached to eth3:

PC1> show ip

NAME        : PC1[1]
IP/MASK     : 192.168.99.5/24
GATEWAY     : 192.168.99.1
DNS         : 192.168.99.1  
MAC         : 00:50:79:66:68:01
LPORT       : 10030
RHOST:PORT  : 127.0.0.1:10031
MTU         : 1500

PC1> ping host66.example.com
host66.example.com resolved to 192.0.2.66

84 bytes from 192.0.2.66 icmp_seq=1 ttl=64 time=0.535 ms
84 bytes from 192.0.2.66 icmp_seq=2 ttl=64 time=0.719 ms

Ok this works :slight_smile: Is there a such option on 1.3 version ?

Thanks :slight_smile:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.