# [SOLVED] dnsmasq openrc config

## kikko

Hi guys

I'm trying to configure dnsmasq as openrc service, but I'm unable to make it work properly

First of all, my needings: I have a work laptop I use on different lans and I want to deal with DNS configurations without having to manually change resolv.conf and /etc/hosts files

I figured out to use dnsmasq, applying a different configuration for each lan (using the --conf-file option)

I've symlinked the init script 

```
/etc/init.d/dnsmasq.customer -> /etc/init.d/dnsmasq

```

 and created a configuration file in conf.d 

```
/etc/conf.d/dnsmasq.customer
```

 which is a copy of /etc/conf.d/dnsmasq edited:

```
# /etc/conf.d/dnsmasq: config file for /etc/init.d/dnsmasq

# See the dnsmasq(8) man page for possible options to put here.

DNSMASQ_OPTS="--conf-file=/home/kikko/Documents/customerX/dnsmasq.conf"
```

But when starting dnsmasq.customer using rc-service, the daemon starts only with the default arguments from /etc/conf.d/dnsmasq

```
~# ps -C dnsmasq -f

UID        PID  PPID  C STIME TTY          TIME CMD

dnsmasq   7052     1  0 10:46 ?        00:00:00 /usr/sbin/dnsmasq -x /var/run/dnsmasq.pid --user=dnsmasq --group=dnsmasq

```

Any idea of what I'm doing wrong?

Thank you in advance

----------

## Logicien

I think rc-service only switch to dnsmasq script when you do

```
rc-service dnsmasq.customer start
```

I would try

```
cp /etc/init.d/dnsmasq /etc/init.d/dnsmasq.customer
```

Than I would edit /etc/init.d/dnsmasq.customer to be sure it source to /etc/conf.d/dnsmasq.customer and not /etc/conf.d/dnsmasq. After this, I would try

```
rc-service dnsmasq.customer start
```

----------

## khayyam

kikko ...

openrc will expect 'customer' to correspond to a runlevel, the syntax is {service}.{interface}.{runlevel} ... or {service}.{runlevel}. See here for an example.

best ... khay

----------

## kikko

Hi guys, thank you for your answers...

I've managed to make it to work, renaming the link (and the conf.d file) in dnsmasq_customer did the trick

----------

