Resolvendo o domínio para o IP errado usando o DNSMASQ

1

Eu tenho duas VMs, uma com meu aplicativo que fala com o outro vm executando asterisco (e centos). A configuração do servidor de aplicativos precisa apontar para a caixa de asterisco. Para evitar ter que mudar minha configuração toda vez que eu me movo entre o escritório e a minha casa ou cafeteria, eu quero usar o dnsmasq.

Estou executando o dnsmasq no meu mac (por link ).

No Virtual Box, eu tenho vboxnet1 definido como 10.203.175.1. E meu vm definitivamente está obtendo seu IP do dnsmasq; Seu IP está no intervalo que eu especifiquei.

Mas se eu fizer o ping de asterisk.vm, ele será resolvido para 10.203.175.1 em vez do IP da vm. Alguma ideia do que eu poderia estar fazendo errado?

Aqui está o meu dnsmasq.conf

# Set this to the name of your VirtualBox host-only interface.
# dnsmasq will listen for DHCP and DNS requests on this interface as
# well as the loopback:
interface=vboxnet1

# This option will be forced anyway on OS X so set here to avoid a warning:
bind-interfaces

# Enable the integrated DHCP server, you need
# to supply the range of addresses available for lease and optionally
# a lease time. If you have more than one network, you will need to
# repeat this for each network on which you want to supply DHCP
# service.
# Select a range from the address and netmask shown in VirtualBox's
# host-only network configuration dialog:
dhcp-range=10.203.175.10,10.203.175.20,12h

# The default directory does not exist on OSX and this cause an 
# error when enabling DHCP, set an alternative location here:
dhcp-leasefile=/var/lib/dnsmasq.leases

# Assume anything in the .vm domain is local
#local=/vm/

# Set this (and domain: see below) if you want to have a domain
# automatically added to simple names in a hosts-file.
expand-hosts

# Set the domain for dnsmasq. this is optional, but if it is set, it
# does the following things.
# 1) Allows DHCP hosts to have fully qualified domain names, as long
#     as the domain part matches this setting.
# 2) Sets the "domain" DHCP option thereby potentially setting the
#    domain of all systems configured by DHCP
# 3) Provides the domain part for "expand-hosts"
domain=vm

# This must be the address of you host on the vboxnet0 network
# find this in the VirtualBox host-only network preferences
address=/asterisk.vm/10.203.175.1
    
por Brad Rhoads 10.04.2014 / 01:11

1 resposta

2
address=/asterisk.vm/10.203.175.1

O dnsmasq está fazendo exatamente o que você disse, respondendo às solicitações de asterisk.vm com o IP 10.203.175.1 . Essa linha deve referenciar o IP da sua VM.

    
por 10.04.2014 / 02:20