TrisNguyen
TrisNguyen

Reputation: 601

Where is dnsmasq.conf in Android phone?

In the command line of Android, there are dnsmasq commands. But where are all the config files (dnsmasq.conf, dnsmasq.pid...)?

As far as I try is creating my own configuration files and using the following command:

dnsmasq --conf-file=the/location/of/my/file

It says:

dnsmasq: failed to open pidfile /var/run/dnsmasq.pid: No such file or directory

When I create pid file it says:

dnsmasq: failed to open pidfile dnsmasq.pid: Read-only file system

Any recommendations on how I can control my dnsmasq (DHCP, DNS server)?

Upvotes: 6

Views: 13492

Answers (4)

Peter Villar
Peter Villar

Reputation: 1

It's normally on /system/etc or just /etc and Try to run dnsmasq via -d or --no-daemon control to avoid the pid file error.

Upvotes: 0

lane
lane

Reputation: 653

Debug mode (-d or --no-daemon) avoids the need for the pid file by not forking, if that helps.

Update: --pid-file with no arguments looks like a nicer way of avoiding the need for a pid file.

Upvotes: 5

JonasVautherin
JonasVautherin

Reputation: 8053

In order to store its process-id, dnsmasq requires a pid file. It therefore requires the right permissions to write it.

You should just create a file called dnsmasq.pid, somewhere on your system, and give it to dnsmasq using dnsmasq --pid-file <path/to/your/dnsmasq.pid>. Be sure that dnsmasq has the rights to access this file.

Upvotes: 1

Mark K Cowan
Mark K Cowan

Reputation: 1863

Sounds like you should probably run it as root to overcome the latter problem. As for the former problem, I have no idea yet. A workaround might be to start dnsmasq with a script, passing config via command line.

Upvotes: 0

Related Questions