Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I work on a project for which I use an Ubuntu server vm on an Ubuntu host.

The VM runs all the services / webapps through haproxy and nginx and serves it on the domain (xyz.com).

I manually modify my resolv.conf to use the VMs IP address as the nameserver and I can run my app on the host browser.

The problem is I am modifying an auto-generated file (resolv.conf) and I need to do it each time.

Is there a smart way to say:

-- are you accessing xyz.com?

-- if yes use VM's DNS server, else use the hosts

share|improve this question
    
Are you asking about BIND (in which case the file is named.conf), or just the system's resolver libraries (which use resolv.conf)? –  MadHatter Nov 14 '12 at 10:07

1 Answer 1

The problem is I am modifying an auto-generated file (resolv.conf) and I need to do it each time.

You can fix this issue, just make "chmod +i /etc/resolv.conf" if you use extended attributes of fs and fs like ext3 or ext4(maybe it works on another, but I'm note sure)

Issue with dns you can fix using different views(for bind dns server): http://www.howtoforge.com/two_in_one_dns_bind9_views

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.