Libvirt- Spoof domains/DNS records, redirect to another IP

Posted
Comments None

I do a lot of work with Arch Linux VMs. Mostly as part of testing my AUR packages, or for building BDisk.

BDisk builds take a long time if your Internet connection isn’t the greatest- the vast majority of this is the package installation in the chroots.

So I referenced this article and sync the repos I need to my virtualizer host. (For those curious, the community, core, extra, multilib, and iso/latest dirs on a mirror combined consume about 70GB. Not a lot at all.)

But now I have a problem- I don’t want to use my primary mirror as my lab’s host machine’s IP, since that breaks pacman functionality for builds in the wild.

So instead I picked a mirror, put it at the top of the mirrorlist, and in my libvirt setu on the host I set a DNS entry for that. Assuming my VM host is 1.2.3.4 (accessible to the VM guest) and I’m running an appropriately mapped web daemon on it (again, accessible to guests):

virsh net-update default add dns-host "<host ip='1.2.3.4'><hostname>foo.domain.tld</hostname></host>" --live --config

Ta-da!

Author
Categories SysAdmin, BDisk

Comments

There are currently no comments on this article.

Comment...

Enter your comment below. Fields marked * are required. You must preview your comment before submitting it.





← Older Newer →